<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# OPTIONS_HADDOCK not-home #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE BangPatterns #-}</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &gt;= 701
</span><span class="hs-pragma">{-# LANGUAGE Safe #-}</span><span>
</span><span id="line-5"></span><span class="hs-pragma">{-# LANGUAGE DeriveGeneric #-}</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-8"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Module      :  Text.PrettyPrint.Annotated.HughesPJ</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Copyright   :  (c) Trevor Elliott &lt;revor@galois.com&gt; 2015</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- License     :  BSD-style (see the file LICENSE)</span><span>
</span><span id="line-13"></span><span class="hs-comment">--</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Maintainer  :  David Terei &lt;code@davidterei.com&gt;</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- Stability   :  stable</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-17"></span><span class="hs-comment">--</span><span>
</span><span id="line-18"></span><span class="hs-comment">-- This module provides a version of pretty that allows for annotations to be</span><span>
</span><span id="line-19"></span><span class="hs-comment">-- attached to documents. Annotations are arbitrary pieces of metadata that can</span><span>
</span><span id="line-20"></span><span class="hs-comment">-- be attached to sub-documents.</span><span>
</span><span id="line-21"></span><span class="hs-comment">--</span><span>
</span><span id="line-22"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span class="hs-cpp">

#ifndef TESTING
</span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Text.PrettyPrint.Annotated.HughesPJ</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-26"></span><span>
</span><span id="line-27"></span><span>        </span><span class="annot"><span class="hs-comment">-- * The document type</span></span><span>
</span><span id="line-28"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier">Doc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextDetails"><span class="hs-identifier">TextDetails</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotDetails"><span class="hs-identifier">AnnotDetails</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-29"></span><span>
</span><span id="line-30"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Constructing documents</span></span><span>
</span><span id="line-31"></span><span>
</span><span id="line-32"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Converting values into documents</span></span><span>
</span><span id="line-33"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier">char</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#text"><span class="hs-identifier">text</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#ptext"><span class="hs-identifier">ptext</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sizedText"><span class="hs-identifier">sizedText</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#zeroWidthText"><span class="hs-identifier">zeroWidthText</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-34"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#int"><span class="hs-identifier">int</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#integer"><span class="hs-identifier">integer</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#float"><span class="hs-identifier">float</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#double"><span class="hs-identifier">double</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#rational"><span class="hs-identifier">rational</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-35"></span><span>
</span><span id="line-36"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Simple derived documents</span></span><span>
</span><span id="line-37"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#semi"><span class="hs-identifier">semi</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#comma"><span class="hs-identifier">comma</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#colon"><span class="hs-identifier">colon</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#space"><span class="hs-identifier">space</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#equals"><span class="hs-identifier">equals</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-38"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#lparen"><span class="hs-identifier">lparen</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#rparen"><span class="hs-identifier">rparen</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#lbrack"><span class="hs-identifier">lbrack</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#rbrack"><span class="hs-identifier">rbrack</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#lbrace"><span class="hs-identifier">lbrace</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#rbrace"><span class="hs-identifier">rbrace</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Wrapping documents in delimiters</span></span><span>
</span><span id="line-41"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#parens"><span class="hs-identifier">parens</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#brackets"><span class="hs-identifier">brackets</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#braces"><span class="hs-identifier">braces</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#quotes"><span class="hs-identifier">quotes</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#doubleQuotes"><span class="hs-identifier">doubleQuotes</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-42"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#maybeParens"><span class="hs-identifier">maybeParens</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#maybeBrackets"><span class="hs-identifier">maybeBrackets</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#maybeBraces"><span class="hs-identifier">maybeBraces</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#maybeQuotes"><span class="hs-identifier">maybeQuotes</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#maybeDoubleQuotes"><span class="hs-identifier">maybeDoubleQuotes</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-43"></span><span>
</span><span id="line-44"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Combining documents</span></span><span>
</span><span id="line-45"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#empty"><span class="hs-identifier">empty</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-46"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%3C%3E"><span class="hs-operator">(&lt;&gt;)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%3C%2B%3E"><span class="hs-operator">(&lt;+&gt;)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#hcat"><span class="hs-identifier">hcat</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#hsep"><span class="hs-identifier">hsep</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-47"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%24%24"><span class="hs-operator">($$)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%24%2B%24"><span class="hs-operator">($+$)</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#vcat"><span class="hs-identifier">vcat</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-48"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sep"><span class="hs-identifier">sep</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#cat"><span class="hs-identifier">cat</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-49"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fsep"><span class="hs-identifier">fsep</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fcat"><span class="hs-identifier">fcat</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-50"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nest"><span class="hs-identifier">nest</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-51"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#hang"><span class="hs-identifier">hang</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#punctuate"><span class="hs-identifier">punctuate</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-52"></span><span>
</span><span id="line-53"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Annotating documents</span></span><span>
</span><span id="line-54"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#annotate"><span class="hs-identifier">annotate</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-55"></span><span>
</span><span id="line-56"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Predicates on documents</span></span><span>
</span><span id="line-57"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#isEmpty"><span class="hs-identifier">isEmpty</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-58"></span><span>
</span><span id="line-59"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Utility functions for documents</span></span><span>
</span><span id="line-60"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#first"><span class="hs-identifier">first</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier">reduceDoc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-61"></span><span>
</span><span id="line-62"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Rendering documents</span></span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Default rendering</span></span><span>
</span><span id="line-65"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#render"><span class="hs-identifier">render</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Annotation rendering</span></span><span>
</span><span id="line-68"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#renderSpans"><span class="hs-identifier">renderSpans</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Span"><span class="hs-identifier">Span</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-69"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#renderDecorated"><span class="hs-identifier">renderDecorated</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-70"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#renderDecoratedM"><span class="hs-identifier">renderDecoratedM</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-71"></span><span>
</span><span id="line-72"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Rendering with a particular style</span></span><span>
</span><span id="line-73"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Style"><span class="hs-identifier">Style</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-74"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier">style</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-75"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#renderStyle"><span class="hs-identifier">renderStyle</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-76"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Mode"><span class="hs-identifier">Mode</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-77"></span><span>
</span><span id="line-78"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** General rendering</span></span><span>
</span><span id="line-79"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fullRender"><span class="hs-identifier">fullRender</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-80"></span><span>        </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fullRenderAnn"><span class="hs-identifier">fullRenderAnn</span></a></span><span>
</span><span id="line-81"></span><span>
</span><span id="line-82"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-85"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#"><span class="hs-identifier">Control.DeepSeq</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#NFData"><span class="hs-identifier">NFData</span></a></span><span class="hs-special">(</span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier">rnf</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-86"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Function.html#"><span class="hs-identifier">Data.Function</span></a></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.Function.html#on"><span class="hs-identifier">on</span></a></span><span> </span><span class="hs-special">)</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &gt;= 803
</span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span>         </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator">(&lt;&gt;)</span></a></span><span> </span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span class="hs-cpp">#if __GLASGOW_HASKELL__ &gt;= 800
</span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.html#"><span class="hs-identifier">Data.Semigroup</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Semi</span></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Semigroup"><span class="hs-identifier">Semigroup</span></a></span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator">(&lt;&gt;)</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span class="hs-cpp">
#elif __GLASGOW_HASKELL__ &lt; 709
</span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Data.Monoid</span><span>     </span><span class="hs-special">(</span><span> </span><span class="hs-identifier">Monoid</span><span class="hs-special">(</span><span class="hs-identifier">mempty</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">mappend</span><span class="hs-special">)</span><span>  </span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.String.html#"><span class="hs-identifier">Data.String</span></a></span><span>     </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.String.html#IsString"><span class="hs-identifier">IsString</span></a></span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.String.html#fromString"><span class="hs-identifier">fromString</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-96"></span><span>
</span><span id="line-97"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/GHC.Generics.html#"><span class="hs-identifier">GHC.Generics</span></a></span><span>
</span><span id="line-98"></span><span>
</span><span id="line-99"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-100"></span><span class="hs-comment">-- The Doc calculus</span><span>
</span><span id="line-101"></span><span>
</span><span id="line-102"></span><span class="hs-comment">{-
Laws for $$
~~~~~~~~~~~
&lt;a1&gt;    (x $$ y) $$ z   = x $$ (y $$ z)
&lt;a2&gt;    empty $$ x      = x
&lt;a3&gt;    x $$ empty      = x

        ...ditto $+$...

Laws for &lt;&gt;
~~~~~~~~~~~
&lt;b1&gt;    (x &lt;&gt; y) &lt;&gt; z   = x &lt;&gt; (y &lt;&gt; z)
&lt;b2&gt;    empty &lt;&gt; x      = empty
&lt;b3&gt;    x &lt;&gt; empty      = x

        ...ditto &lt;+&gt;...

Laws for text
~~~~~~~~~~~~~
&lt;t1&gt;    text s &lt;&gt; text t        = text (s++t)
&lt;t2&gt;    text &quot;&quot; &lt;&gt; x            = x, if x non-empty

** because of law n6, t2 only holds if x doesn't
** start with `nest'.


Laws for nest
~~~~~~~~~~~~~
&lt;n1&gt;    nest 0 x                = x
&lt;n2&gt;    nest k (nest k' x)      = nest (k+k') x
&lt;n3&gt;    nest k (x &lt;&gt; y)         = nest k x &lt;&gt; nest k y
&lt;n4&gt;    nest k (x $$ y)         = nest k x $$ nest k y
&lt;n5&gt;    nest k empty            = empty
&lt;n6&gt;    x &lt;&gt; nest k y           = x &lt;&gt; y, if x non-empty

** Note the side condition on &lt;n6&gt;!  It is this that
** makes it OK for empty to be a left unit for &lt;&gt;.

Miscellaneous
~~~~~~~~~~~~~
&lt;m1&gt;    (text s &lt;&gt; x) $$ y = text s &lt;&gt; ((text &quot;&quot; &lt;&gt; x) $$
                                         nest (-length s) y)

&lt;m2&gt;    (x $$ y) &lt;&gt; z = x $$ (y &lt;&gt; z)
        if y non-empty


Laws for list versions
~~~~~~~~~~~~~~~~~~~~~~
&lt;l1&gt;    sep (ps++[empty]++qs)   = sep (ps ++ qs)
        ...ditto hsep, hcat, vcat, fill...

&lt;l2&gt;    nest k (sep ps) = sep (map (nest k) ps)
        ...ditto hsep, hcat, vcat, fill...

Laws for oneLiner
~~~~~~~~~~~~~~~~~
&lt;o1&gt;    oneLiner (nest k p) = nest k (oneLiner p)
&lt;o2&gt;    oneLiner (x &lt;&gt; y)   = oneLiner x &lt;&gt; oneLiner y

You might think that the following verion of &lt;m1&gt; would
be neater:

&lt;3 NO&gt;  (text s &lt;&gt; x) $$ y = text s &lt;&gt; ((empty &lt;&gt; x)) $$
                                         nest (-length s) y)

But it doesn't work, for if x=empty, we would have

        text s $$ y = text s &lt;&gt; (empty $$ nest (-length s) y)
                    = text s &lt;&gt; nest (-length s) y
-}</span><span>
</span><span id="line-173"></span><span>
</span><span id="line-174"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-175"></span><span class="hs-comment">-- Operator fixity</span><span>
</span><span id="line-176"></span><span>
</span><span id="line-177"></span><span class="hs-keyword">infixl</span><span> </span><span class="hs-number">6</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%3C%3E"><span class="hs-operator hs-type">&lt;&gt;</span></a></span><span>
</span><span id="line-178"></span><span class="hs-keyword">infixl</span><span> </span><span class="hs-number">6</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%3C%2B%3E"><span class="hs-operator hs-type">&lt;+&gt;</span></a></span><span>
</span><span id="line-179"></span><span class="hs-keyword">infixl</span><span> </span><span class="hs-number">5</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%24%24"><span class="hs-operator hs-type">$$</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%24%2B%24"><span class="hs-operator hs-type">$+$</span></a></span><span>
</span><span id="line-180"></span><span>
</span><span id="line-181"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-182"></span><span class="hs-comment">-- The Doc data type</span><span>
</span><span id="line-183"></span><span>
</span><span id="line-184"></span><span class="hs-comment">-- | The abstract type of documents. A Doc represents a /set/ of layouts. A Doc</span><span>
</span><span id="line-185"></span><span class="hs-comment">-- with no occurrences of Union or NoDoc represents just one layout.</span><span>
</span><span id="line-186"></span><span id="local-6989586621679048930"><span id="local-6989586621679048931"></span></span><span class="hs-keyword">data</span><span> </span><span id="Doc"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-var">Doc</span></a></span></span><span> </span><span id="local-6989586621679049274"><span class="annot"><a href="#local-6989586621679049274"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-187"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="Empty"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span></span><span>                                            </span><span class="hs-comment">-- ^ An empty span, see 'empty'.</span><span>
</span><span id="line-188"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="NilAbove"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NilAbove"><span class="hs-identifier hs-var">NilAbove</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049274"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>                                 </span><span class="hs-comment">-- ^ @text &quot;&quot; $$ x@.</span><span>
</span><span id="line-189"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="TextBeside"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextBeside"><span class="hs-identifier hs-var">TextBeside</span></a></span></span><span> </span><span class="hs-glyph">!</span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotDetails"><span class="hs-identifier hs-type">AnnotDetails</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049274"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049274"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>             </span><span class="hs-comment">-- ^ @text s &lt;&gt; x@.</span><span>
</span><span id="line-190"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Nest"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Nest"><span class="hs-identifier hs-var">Nest</span></a></span></span><span> </span><span class="hs-pragma">{-# UNPACK</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049274"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>                 </span><span class="hs-comment">-- ^ @nest k x@.</span><span>
</span><span id="line-191"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Union"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Union"><span class="hs-identifier hs-var">Union</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049274"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049274"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>                            </span><span class="hs-comment">-- ^ @ul `union` ur@.</span><span>
</span><span id="line-192"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="NoDoc"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span></span><span>                                            </span><span class="hs-comment">-- ^ The empty set of documents.</span><span>
</span><span id="line-193"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Beside"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Beside"><span class="hs-identifier hs-var">Beside</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049274"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049274"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>                      </span><span class="hs-comment">-- ^ True &lt;=&gt; space between.</span><span>
</span><span id="line-194"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span id="Above"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Above"><span class="hs-identifier hs-var">Above</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049274"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049274"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>                       </span><span class="hs-comment">-- ^ True &lt;=&gt; never overlap.</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &gt;= 701
</span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(forall x. Doc a -&gt; Rep (Doc a) x)
-&gt; (forall x. Rep (Doc a) x -&gt; Doc a) -&gt; Generic (Doc a)
forall x. Rep (Doc a) x -&gt; Doc a
forall x. Doc a -&gt; Rep (Doc a) x
forall a.
(forall x. a -&gt; Rep a x) -&gt; (forall x. Rep a x -&gt; a) -&gt; Generic a
forall a x. Rep (Doc a) x -&gt; Doc a
forall a x. Doc a -&gt; Rep (Doc a) x
$cto :: forall a x. Rep (Doc a) x -&gt; Doc a
$cfrom :: forall a x. Doc a -&gt; Rep (Doc a) x
</span><a href="../../base/src/GHC.Generics.html#Generic"><span class="hs-identifier hs-var hs-var hs-var hs-var">Generic</span></a></span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-199"></span><span class="hs-comment">{-
Here are the invariants:

1) The argument of NilAbove is never Empty. Therefore a NilAbove occupies at
least two lines.

2) The argument of @TextBeside@ is never @Nest@.

3) The layouts of the two arguments of @Union@ both flatten to the same string.

4) The arguments of @Union@ are either @TextBeside@, or @NilAbove@.

5) A @NoDoc@ may only appear on the first line of the left argument of an
   union. Therefore, the right argument of an union can never be equivalent to
   the empty set (@NoDoc@).

6) An empty document is always represented by @Empty@. It can't be hidden
   inside a @Nest@, or a @Union@ of two @Empty@s.

7) The first line of every layout in the left argument of @Union@ is longer
   than the first line of any layout in the right argument. (1) ensures that
   the left argument has a first line. In view of (3), this invariant means
   that the right argument must have at least two lines.

Notice the difference between
   * NoDoc (no documents)
   * Empty (one empty document; no height and no width)
   * text &quot;&quot; (a document containing the empty string; one line high, but has no
              width)
-}</span><span>
</span><span id="line-229"></span><span>
</span><span id="line-230"></span><span>
</span><span id="line-231"></span><span class="hs-comment">-- | RDoc is a &quot;reduced GDoc&quot;, guaranteed not to have a top-level Above or Beside.</span><span>
</span><span id="line-232"></span><span class="hs-keyword">type</span><span> </span><span id="RDoc"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-var">RDoc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-233"></span><span>
</span><span id="line-234"></span><span class="hs-comment">-- | An annotation (side-metadata) attached at a particular point in a @Doc@.</span><span>
</span><span id="line-235"></span><span class="hs-comment">-- Allows carrying non-pretty-printed data around in a @Doc@ that is attached</span><span>
</span><span id="line-236"></span><span class="hs-comment">-- at particular points in the structure. Once the @Doc@ is render to an output</span><span>
</span><span id="line-237"></span><span class="hs-comment">-- type (such as 'String'), we can also retrieve where in the rendered document</span><span>
</span><span id="line-238"></span><span class="hs-comment">-- our annotations start and end (see 'Span' and 'renderSpans').</span><span>
</span><span id="line-239"></span><span class="hs-keyword">data</span><span> </span><span id="AnnotDetails"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotDetails"><span class="hs-identifier hs-var">AnnotDetails</span></a></span></span><span> </span><span id="local-6989586621679049271"><span class="annot"><a href="#local-6989586621679049271"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="AnnotStart"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotStart"><span class="hs-identifier hs-var">AnnotStart</span></a></span></span><span>
</span><span id="line-240"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span id="NoAnnot"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoAnnot"><span class="hs-identifier hs-var">NoAnnot</span></a></span></span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextDetails"><span class="hs-identifier hs-type">TextDetails</span></a></span><span> </span><span class="hs-pragma">{-# UNPACK</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>
</span><span id="line-241"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span id="AnnotEnd"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotEnd"><span class="hs-identifier hs-var">AnnotEnd</span></a></span></span><span> </span><span class="annot"><a href="#local-6989586621679049271"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-242"></span><span>                      </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679048902"><span id="local-6989586621679048904"><span id="local-6989586621679048913"><span class="annot"><span class="annottext">Int -&gt; AnnotDetails a -&gt; ShowS
[AnnotDetails a] -&gt; ShowS
AnnotDetails a -&gt; String
(Int -&gt; AnnotDetails a -&gt; ShowS)
-&gt; (AnnotDetails a -&gt; String)
-&gt; ([AnnotDetails a] -&gt; ShowS)
-&gt; Show (AnnotDetails a)
forall a. Show a =&gt; Int -&gt; AnnotDetails a -&gt; ShowS
forall a. Show a =&gt; [AnnotDetails a] -&gt; ShowS
forall a. Show a =&gt; AnnotDetails a -&gt; String
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; String) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [AnnotDetails a] -&gt; ShowS
$cshowList :: forall a. Show a =&gt; [AnnotDetails a] -&gt; ShowS
show :: AnnotDetails a -&gt; String
$cshow :: forall a. Show a =&gt; AnnotDetails a -&gt; String
showsPrec :: Int -&gt; AnnotDetails a -&gt; ShowS
$cshowsPrec :: forall a. Show a =&gt; Int -&gt; AnnotDetails a -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span class="hs-special">,</span><span id="local-6989586621679048893"><span id="local-6989586621679048899"><span class="annot"><span class="annottext">AnnotDetails a -&gt; AnnotDetails a -&gt; Bool
(AnnotDetails a -&gt; AnnotDetails a -&gt; Bool)
-&gt; (AnnotDetails a -&gt; AnnotDetails a -&gt; Bool)
-&gt; Eq (AnnotDetails a)
forall a. Eq a =&gt; AnnotDetails a -&gt; AnnotDetails a -&gt; Bool
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: AnnotDetails a -&gt; AnnotDetails a -&gt; Bool
$c/= :: forall a. Eq a =&gt; AnnotDetails a -&gt; AnnotDetails a -&gt; Bool
== :: AnnotDetails a -&gt; AnnotDetails a -&gt; Bool
$c== :: forall a. Eq a =&gt; AnnotDetails a -&gt; AnnotDetails a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></a></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-243"></span><span>
</span><span id="line-244"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679048889"><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotDetails"><span class="hs-identifier hs-type">AnnotDetails</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-245"></span><span>  </span><span id="local-6989586621679048887"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; AnnotDetails a -&gt; AnnotDetails b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotStart"><span class="hs-identifier hs-var">AnnotStart</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotDetails b
forall a. AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotStart"><span class="hs-identifier hs-var">AnnotStart</span></a></span><span>
</span><span id="line-246"></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoAnnot"><span class="hs-identifier hs-type">NoAnnot</span></a></span><span> </span><span id="local-6989586621679048886"><span class="annot"><span class="annottext">TextDetails
</span><a href="#local-6989586621679048886"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span id="local-6989586621679048885"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048885"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TextDetails -&gt; Int -&gt; AnnotDetails b
forall a. TextDetails -&gt; Int -&gt; AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoAnnot"><span class="hs-identifier hs-var">NoAnnot</span></a></span><span> </span><span class="annot"><span class="annottext">TextDetails
</span><a href="#local-6989586621679048886"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048885"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-247"></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span id="local-6989586621679048884"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679048884"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotEnd"><span class="hs-identifier hs-type">AnnotEnd</span></a></span><span> </span><span id="local-6989586621679048883"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679048883"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; AnnotDetails b
forall a. a -&gt; AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotEnd"><span class="hs-identifier hs-var">AnnotEnd</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679048884"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679048883"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-248"></span><span>
</span><span id="line-249"></span><span class="hs-comment">-- NOTE: Annotations are assumed to have zero length; only text has a length.</span><span>
</span><span id="line-250"></span><span id="local-6989586621679049262"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#annotSize"><span class="hs-identifier hs-type">annotSize</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotDetails"><span class="hs-identifier hs-type">AnnotDetails</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049262"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span></span><span>
</span><span id="line-251"></span><span id="annotSize"><span class="annot"><span class="annottext">annotSize :: forall a. AnnotDetails a -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#annotSize"><span class="hs-identifier hs-var hs-var">annotSize</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoAnnot"><span class="hs-identifier hs-type">NoAnnot</span></a></span><span> </span><span class="annot"><span class="annottext">TextDetails
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679048881"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048881"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048881"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-252"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#annotSize"><span class="hs-identifier hs-var">annotSize</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a
</span><span class="hs-identifier">_</span></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-253"></span><span>
</span><span id="line-254"></span><span class="hs-comment">-- | A TextDetails represents a fragment of text that will be output at some</span><span>
</span><span id="line-255"></span><span class="hs-comment">-- point in a @Doc@.</span><span>
</span><span id="line-256"></span><span id="local-6989586621679048879"><span id="local-6989586621679048880"></span></span><span class="hs-keyword">data</span><span> </span><span id="TextDetails"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextDetails"><span class="hs-identifier hs-var">TextDetails</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Chr"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Chr"><span class="hs-identifier hs-var">Chr</span></a></span></span><span>  </span><span class="hs-pragma">{-# UNPACK</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-comment">-- ^ A single Char fragment</span><span>
</span><span id="line-257"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span id="Str"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Str"><span class="hs-identifier hs-var">Str</span></a></span></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-comment">-- ^ A whole String fragment</span><span>
</span><span id="line-258"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span id="PStr"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#PStr"><span class="hs-identifier hs-var">PStr</span></a></span></span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-comment">-- ^ Used to represent a Fast String fragment</span><span>
</span><span id="line-259"></span><span>                               </span><span class="hs-comment">--   but now deprecated and identical to the</span><span>
</span><span id="line-260"></span><span>                               </span><span class="hs-comment">--   Str constructor.</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &gt;= 701
</span><span>                 </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679048862"><span id="local-6989586621679048864"><span id="local-6989586621679048874"><span class="annot"><span class="annottext">Int -&gt; TextDetails -&gt; ShowS
[TextDetails] -&gt; ShowS
TextDetails -&gt; String
(Int -&gt; TextDetails -&gt; ShowS)
-&gt; (TextDetails -&gt; String)
-&gt; ([TextDetails] -&gt; ShowS)
-&gt; Show TextDetails
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; String) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [TextDetails] -&gt; ShowS
$cshowList :: [TextDetails] -&gt; ShowS
show :: TextDetails -&gt; String
$cshow :: TextDetails -&gt; String
showsPrec :: Int -&gt; TextDetails -&gt; ShowS
$cshowsPrec :: Int -&gt; TextDetails -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679048853"><span id="local-6989586621679048860"><span class="annot"><span class="annottext">TextDetails -&gt; TextDetails -&gt; Bool
(TextDetails -&gt; TextDetails -&gt; Bool)
-&gt; (TextDetails -&gt; TextDetails -&gt; Bool) -&gt; Eq TextDetails
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: TextDetails -&gt; TextDetails -&gt; Bool
$c/= :: TextDetails -&gt; TextDetails -&gt; Bool
== :: TextDetails -&gt; TextDetails -&gt; Bool
$c== :: TextDetails -&gt; TextDetails -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></a></span></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(forall x. TextDetails -&gt; Rep TextDetails x)
-&gt; (forall x. Rep TextDetails x -&gt; TextDetails)
-&gt; Generic TextDetails
forall x. Rep TextDetails x -&gt; TextDetails
forall x. TextDetails -&gt; Rep TextDetails x
forall a.
(forall x. a -&gt; Rep a x) -&gt; (forall x. Rep a x -&gt; a) -&gt; Generic a
$cto :: forall x. Rep TextDetails x -&gt; TextDetails
$cfrom :: forall x. TextDetails -&gt; Rep TextDetails x
</span><a href="../../base/src/GHC.Generics.html#Generic"><span class="hs-identifier hs-var hs-var hs-var hs-var">Generic</span></a></span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-265"></span><span class="hs-comment">-- Combining @Doc@ values</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &gt;= 800
</span><span id="local-6989586621679049255"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679048845"><span id="local-6989586621679048847"><span class="annot"><a href="../../base/src/GHC.Base.html#Semigroup"><span class="hs-identifier hs-type">Semi.Semigroup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049255"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">
#ifndef TESTING
</span><span>    </span><span id="local-6989586621679048843"><span class="annot"><span class="annottext">&lt;&gt; :: Doc a -&gt; Doc a -&gt; Doc a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">(Text.PrettyPrint.Annotated.HughesPJ.&lt;&gt;)</span></a></span></span><span class="hs-cpp">
#else
</span><span>    </span><span class="hs-special">(</span><span class="hs-operator">&lt;&gt;</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-operator">PrettyTestVersion.&lt;&gt;</span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-274"></span><span id="local-6989586621679049253"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679048837"><span class="annot"><a href="../../base/src/GHC.Base.html#Monoid"><span class="hs-identifier hs-type">Monoid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049253"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-275"></span><span>    </span><span id="local-6989586621679048835"><span class="annot"><span class="annottext">mempty :: Doc a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var hs-var hs-var hs-var">mempty</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-276"></span><span>    </span><span id="local-6989586621679048833"><span class="annot"><span class="annottext">mappend :: Doc a -&gt; Doc a -&gt; Doc a
</span><a href="../../base/src/GHC.Base.html#mappend"><span class="hs-identifier hs-var hs-var hs-var hs-var">mappend</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a -&gt; Doc a
forall a. Semigroup a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator hs-var">(Semi.&lt;&gt;)</span></a></span></span><span class="hs-cpp">
#else
</span><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier">Monoid</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Doc</span><span> </span><span class="hs-identifier">a</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-279"></span><span>    </span><span class="hs-identifier">mempty</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">empty</span><span>
</span><span id="line-280"></span><span>    </span><span class="hs-identifier">mappend</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-operator">&lt;&gt;</span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-283"></span><span id="local-6989586621679049250"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../base/src/Data.String.html#IsString"><span class="hs-identifier hs-type">IsString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049250"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-284"></span><span>    </span><span id="local-6989586621679048829"><span class="annot"><span class="annottext">fromString :: String -&gt; Doc a
</span><a href="../../base/src/Data.String.html#fromString"><span class="hs-identifier hs-var hs-var hs-var hs-var">fromString</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Doc a
forall a. String -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#text"><span class="hs-identifier hs-var">text</span></a></span></span><span>
</span><span id="line-285"></span><span>
</span><span id="line-286"></span><span id="local-6989586621679049249"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679048824"><span id="local-6989586621679048826"><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049249"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-287"></span><span>  </span><span id="local-6989586621679048823"><span class="annot"><span class="annottext">showsPrec :: Int -&gt; Doc a -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#showsPrec"><span class="hs-identifier hs-var hs-var hs-var hs-var">showsPrec</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679048821"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048821"><span class="hs-identifier hs-var">doc</span></a></span></span><span> </span><span id="local-6989586621679048820"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048820"><span class="hs-identifier hs-var">cont</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mode
-&gt; Int
-&gt; Float
-&gt; (TextDetails -&gt; ShowS)
-&gt; String
-&gt; Doc a
-&gt; String
forall a b.
Mode -&gt; Int -&gt; Float -&gt; (TextDetails -&gt; a -&gt; a) -&gt; a -&gt; Doc b -&gt; a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fullRender"><span class="hs-identifier hs-var">fullRender</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Mode
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mode"><span class="hs-identifier hs-var hs-var">mode</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-var">style</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#lineLength"><span class="hs-identifier hs-var hs-var">lineLength</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-var">style</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-288"></span><span>                                    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Float
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#ribbonsPerLine"><span class="hs-identifier hs-var hs-var">ribbonsPerLine</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-var">style</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-289"></span><span>                                    </span><span class="annot"><span class="annottext">TextDetails -&gt; ShowS
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#txtPrinter"><span class="hs-identifier hs-var">txtPrinter</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048820"><span class="hs-identifier hs-var">cont</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048821"><span class="hs-identifier hs-var">doc</span></a></span></span><span>
</span><span id="line-290"></span><span>
</span><span id="line-291"></span><span id="local-6989586621679049246"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679048813"><span class="annot"><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-type">Eq</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049246"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-292"></span><span>  </span><span id="local-6989586621679048810"><span class="annot"><span class="annottext">== :: Doc a -&gt; Doc a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">(==)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">(==)</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; String -&gt; Bool)
-&gt; (Doc a -&gt; String) -&gt; Doc a -&gt; Doc a -&gt; Bool
forall b c a. (b -&gt; b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; a -&gt; c
</span><a href="../../base/src/Data.Function.html#on"><span class="hs-operator hs-var">`on`</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; String
forall a. Doc a -&gt; String
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#render"><span class="hs-identifier hs-var">render</span></a></span></span><span>
</span><span id="line-293"></span><span>
</span><span id="line-294"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679048807"><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-295"></span><span>  </span><span id="local-6989586621679048796"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; Doc a -&gt; Doc b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc b
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-296"></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span id="local-6989586621679048795"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679048795"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NilAbove"><span class="hs-identifier hs-type">NilAbove</span></a></span><span> </span><span id="local-6989586621679048794"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048794"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc b -&gt; Doc b
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NilAbove"><span class="hs-identifier hs-var">NilAbove</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; Doc a -&gt; Doc b
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679048795"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048794"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-297"></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span id="local-6989586621679048793"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679048793"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextBeside"><span class="hs-identifier hs-type">TextBeside</span></a></span><span> </span><span id="local-6989586621679048792"><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048792"><span class="hs-identifier hs-var">td</span></a></span></span><span> </span><span id="local-6989586621679048791"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048791"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotDetails b -&gt; Doc b -&gt; Doc b
forall a. AnnotDetails a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextBeside"><span class="hs-identifier hs-var">TextBeside</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; AnnotDetails a -&gt; AnnotDetails b
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679048793"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048792"><span class="hs-identifier hs-var">td</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; Doc a -&gt; Doc b
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679048793"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048791"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-298"></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span id="local-6989586621679048790"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679048790"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Nest"><span class="hs-identifier hs-type">Nest</span></a></span><span> </span><span id="local-6989586621679048789"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048789"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048788"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048788"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Doc b -&gt; Doc b
forall a. Int -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Nest"><span class="hs-identifier hs-var">Nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048789"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; Doc a -&gt; Doc b
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679048790"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048788"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-299"></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span id="local-6989586621679048787"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679048787"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Union"><span class="hs-identifier hs-type">Union</span></a></span><span> </span><span id="local-6989586621679048786"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048786"><span class="hs-identifier hs-var">ur</span></a></span></span><span> </span><span id="local-6989586621679048785"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048785"><span class="hs-identifier hs-var">ul</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc b -&gt; Doc b -&gt; Doc b
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Union"><span class="hs-identifier hs-var">Union</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; Doc a -&gt; Doc b
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679048787"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048786"><span class="hs-identifier hs-var">ur</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; Doc a -&gt; Doc b
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679048787"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048785"><span class="hs-identifier hs-var">ul</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-300"></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc b
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>
</span><span id="line-301"></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span id="local-6989586621679048784"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679048784"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Beside"><span class="hs-identifier hs-type">Beside</span></a></span><span> </span><span id="local-6989586621679048783"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048783"><span class="hs-identifier hs-var">ld</span></a></span></span><span> </span><span id="local-6989586621679048782"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048782"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679048781"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048781"><span class="hs-identifier hs-var">rd</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc b -&gt; Bool -&gt; Doc b -&gt; Doc b
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Beside"><span class="hs-identifier hs-var">Beside</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; Doc a -&gt; Doc b
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679048784"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048783"><span class="hs-identifier hs-var">ld</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048782"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; Doc a -&gt; Doc b
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679048784"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048781"><span class="hs-identifier hs-var">rd</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-302"></span><span>  </span><span class="annot"><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span id="local-6989586621679048780"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679048780"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Above"><span class="hs-identifier hs-type">Above</span></a></span><span> </span><span id="local-6989586621679048779"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048779"><span class="hs-identifier hs-var">ud</span></a></span></span><span> </span><span id="local-6989586621679048778"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048778"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679048777"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048777"><span class="hs-identifier hs-var">ld</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc b -&gt; Bool -&gt; Doc b -&gt; Doc b
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Above"><span class="hs-identifier hs-var">Above</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; Doc a -&gt; Doc b
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679048780"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048779"><span class="hs-identifier hs-var">ud</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048778"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; Doc a -&gt; Doc b
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679048780"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048777"><span class="hs-identifier hs-var">ld</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-303"></span><span>
</span><span id="line-304"></span><span id="local-6989586621679049237"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#NFData"><span class="hs-identifier hs-type">NFData</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049237"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#NFData"><span class="hs-identifier hs-type">NFData</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049237"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-305"></span><span>  </span><span id="local-6989586621679048756"><span class="annot"><span class="annottext">rnf :: Doc a -&gt; ()
</span><a href="#local-6989586621679048756"><span class="hs-identifier hs-var hs-var hs-var hs-var">rnf</span></a></span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-306"></span><span>  </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NilAbove"><span class="hs-identifier hs-type">NilAbove</span></a></span><span> </span><span id="local-6989586621679048755"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048755"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; ()
forall a. NFData a =&gt; a -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048755"><span class="hs-identifier hs-var">d</span></a></span><span>
</span><span id="line-307"></span><span>  </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextBeside"><span class="hs-identifier hs-type">TextBeside</span></a></span><span> </span><span id="local-6989586621679048754"><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048754"><span class="hs-identifier hs-var">td</span></a></span></span><span> </span><span id="local-6989586621679048753"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048753"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotDetails a -&gt; ()
forall a. NFData a =&gt; a -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048754"><span class="hs-identifier hs-var">td</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; () -&gt; ()
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; ()
forall a. NFData a =&gt; a -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048753"><span class="hs-identifier hs-var">d</span></a></span><span>
</span><span id="line-308"></span><span>  </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Nest"><span class="hs-identifier hs-type">Nest</span></a></span><span> </span><span id="local-6989586621679048752"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048752"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048751"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048751"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; ()
forall a. NFData a =&gt; a -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048752"><span class="hs-identifier hs-var">k</span></a></span><span>  </span><span class="annot"><span class="annottext">() -&gt; () -&gt; ()
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; ()
forall a. NFData a =&gt; a -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048751"><span class="hs-identifier hs-var">d</span></a></span><span>
</span><span id="line-309"></span><span>  </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Union"><span class="hs-identifier hs-type">Union</span></a></span><span> </span><span id="local-6989586621679048750"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048750"><span class="hs-identifier hs-var">ur</span></a></span></span><span> </span><span id="local-6989586621679048749"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048749"><span class="hs-identifier hs-var">ul</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; ()
forall a. NFData a =&gt; a -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048750"><span class="hs-identifier hs-var">ur</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; () -&gt; ()
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; ()
forall a. NFData a =&gt; a -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048749"><span class="hs-identifier hs-var">ul</span></a></span><span>
</span><span id="line-310"></span><span>  </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-311"></span><span>  </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Beside"><span class="hs-identifier hs-type">Beside</span></a></span><span> </span><span id="local-6989586621679048748"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048748"><span class="hs-identifier hs-var">ld</span></a></span></span><span> </span><span id="local-6989586621679048747"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048747"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679048746"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048746"><span class="hs-identifier hs-var">rd</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; ()
forall a. NFData a =&gt; a -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048748"><span class="hs-identifier hs-var">ld</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; () -&gt; ()
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; ()
forall a. NFData a =&gt; a -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048747"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; () -&gt; ()
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; ()
forall a. NFData a =&gt; a -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048746"><span class="hs-identifier hs-var">rd</span></a></span><span>
</span><span id="line-312"></span><span>  </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Above"><span class="hs-identifier hs-type">Above</span></a></span><span> </span><span id="local-6989586621679048745"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048745"><span class="hs-identifier hs-var">ud</span></a></span></span><span> </span><span id="local-6989586621679048744"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048744"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679048743"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048743"><span class="hs-identifier hs-var">ld</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; ()
forall a. NFData a =&gt; a -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048745"><span class="hs-identifier hs-var">ud</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; () -&gt; ()
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; ()
forall a. NFData a =&gt; a -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048744"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; () -&gt; ()
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; ()
forall a. NFData a =&gt; a -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048743"><span class="hs-identifier hs-var">ld</span></a></span></span><span>
</span><span id="line-313"></span><span>
</span><span id="line-314"></span><span id="local-6989586621679049236"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#NFData"><span class="hs-identifier hs-type">NFData</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049236"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#NFData"><span class="hs-identifier hs-type">NFData</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotDetails"><span class="hs-identifier hs-type">AnnotDetails</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049236"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-315"></span><span>  </span><span id="local-6989586621679048736"><span class="annot"><span class="annottext">rnf :: AnnotDetails a -&gt; ()
</span><a href="#local-6989586621679048736"><span class="hs-identifier hs-var hs-var hs-var hs-var">rnf</span></a></span></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotStart"><span class="hs-identifier hs-var">AnnotStart</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-316"></span><span>  </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoAnnot"><span class="hs-identifier hs-type">NoAnnot</span></a></span><span> </span><span id="local-6989586621679048735"><span class="annot"><span class="annottext">TextDetails
</span><a href="#local-6989586621679048735"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span id="local-6989586621679048734"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048734"><span class="hs-identifier hs-var">sl</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TextDetails -&gt; ()
forall a. NFData a =&gt; a -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">TextDetails
</span><a href="#local-6989586621679048735"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; () -&gt; ()
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; ()
forall a. NFData a =&gt; a -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048734"><span class="hs-identifier hs-var">sl</span></a></span><span>
</span><span id="line-317"></span><span>  </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotEnd"><span class="hs-identifier hs-type">AnnotEnd</span></a></span><span> </span><span id="local-6989586621679048733"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679048733"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; ()
forall a. NFData a =&gt; a -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679048733"><span class="hs-identifier hs-var">a</span></a></span></span><span>
</span><span id="line-318"></span><span>
</span><span id="line-319"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#NFData"><span class="hs-identifier hs-type">NFData</span></a></span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextDetails"><span class="hs-identifier hs-type">TextDetails</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-320"></span><span>  </span><span id="local-6989586621679048726"><span class="annot"><span class="annottext">rnf :: TextDetails -&gt; ()
</span><a href="#local-6989586621679048726"><span class="hs-identifier hs-var hs-var hs-var hs-var">rnf</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Chr"><span class="hs-identifier hs-type">Chr</span></a></span><span> </span><span id="local-6989586621679048725"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679048725"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; ()
forall a. NFData a =&gt; a -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679048725"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-321"></span><span>  </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Str"><span class="hs-identifier hs-type">Str</span></a></span><span> </span><span id="local-6989586621679048724"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048724"><span class="hs-identifier hs-var">str</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ()
forall a. NFData a =&gt; a -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048724"><span class="hs-identifier hs-var">str</span></a></span><span>
</span><span id="line-322"></span><span>  </span><span class="annot"><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#PStr"><span class="hs-identifier hs-type">PStr</span></a></span><span> </span><span id="local-6989586621679048723"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048723"><span class="hs-identifier hs-var">str</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ()
forall a. NFData a =&gt; a -&gt; ()
</span><a href="../../deepseq/src/Control.DeepSeq.html#rnf"><span class="hs-identifier hs-var">rnf</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048723"><span class="hs-identifier hs-var">str</span></a></span><span>
</span><span id="line-323"></span><span>
</span><span id="line-324"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-325"></span><span class="hs-comment">-- Values and Predicates on GDocs and TextDetails</span><span>
</span><span id="line-326"></span><span>
</span><span id="line-327"></span><span class="hs-comment">-- | Attach an annotation to a document.</span><span>
</span><span id="line-328"></span><span id="local-6989586621679049230"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#annotate"><span class="hs-identifier hs-type">annotate</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679049230"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049230"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049230"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-329"></span><span id="annotate"><span class="annot"><span class="annottext">annotate :: forall a. a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#annotate"><span class="hs-identifier hs-var hs-var">annotate</span></a></span></span><span> </span><span id="local-6989586621679048722"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679048722"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679048721"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048721"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotDetails a -&gt; Doc a -&gt; Doc a
forall a. AnnotDetails a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextBeside"><span class="hs-identifier hs-var">TextBeside</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a
forall a. AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotStart"><span class="hs-identifier hs-var">AnnotStart</span></a></span><span>
</span><span id="line-330"></span><span>             </span><span class="annot"><span class="annottext">(Doc a -&gt; Doc a) -&gt; Doc a -&gt; Doc a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside"><span class="hs-identifier hs-var">beside</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var">reduceDoc</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048721"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span>
</span><span id="line-331"></span><span>             </span><span class="annot"><span class="annottext">(Doc a -&gt; Doc a) -&gt; Doc a -&gt; Doc a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a -&gt; Doc a -&gt; Doc a
forall a. AnnotDetails a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextBeside"><span class="hs-identifier hs-var">TextBeside</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; AnnotDetails a
forall a. a -&gt; AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotEnd"><span class="hs-identifier hs-var">AnnotEnd</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679048722"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-332"></span><span>
</span><span id="line-333"></span><span>
</span><span id="line-334"></span><span class="hs-comment">-- | A document of height and width 1, containing a literal character.</span><span>
</span><span id="line-335"></span><span id="local-6989586621679049225"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-type">char</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Char"><span class="hs-identifier hs-type">Char</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049225"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-336"></span><span id="char"><span class="annot"><span class="annottext">char :: forall a. Char -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-var hs-var">char</span></a></span></span><span> </span><span id="local-6989586621679048719"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679048719"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotDetails a -&gt; RDoc a -&gt; RDoc a
forall a. AnnotDetails a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#textBeside_"><span class="hs-identifier hs-var">textBeside_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TextDetails -&gt; Int -&gt; AnnotDetails a
forall a. TextDetails -&gt; Int -&gt; AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoAnnot"><span class="hs-identifier hs-var">NoAnnot</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; TextDetails
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Chr"><span class="hs-identifier hs-var">Chr</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679048719"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">RDoc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-337"></span><span>
</span><span id="line-338"></span><span class="hs-comment">-- | A document of height 1 containing a literal string.</span><span>
</span><span id="line-339"></span><span class="hs-comment">-- 'text' satisfies the following laws:</span><span>
</span><span id="line-340"></span><span class="hs-comment">--</span><span>
</span><span id="line-341"></span><span class="hs-comment">-- * @'text' s '&lt;&gt;' 'text' t = 'text' (s'++'t)@</span><span>
</span><span id="line-342"></span><span class="hs-comment">--</span><span>
</span><span id="line-343"></span><span class="hs-comment">-- * @'text' \&quot;\&quot; '&lt;&gt;' x = x@, if @x@ non-empty</span><span>
</span><span id="line-344"></span><span class="hs-comment">--</span><span>
</span><span id="line-345"></span><span class="hs-comment">-- The side condition on the last law is necessary because @'text' \&quot;\&quot;@</span><span>
</span><span id="line-346"></span><span class="hs-comment">-- has height 1, while 'empty' has no height.</span><span>
</span><span id="line-347"></span><span id="local-6989586621679048717"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#text"><span class="hs-identifier hs-type">text</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048717"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-348"></span><span id="text"><span class="annot"><span class="annottext">text :: forall a. String -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#text"><span class="hs-identifier hs-var hs-var">text</span></a></span></span><span> </span><span id="local-6989586621679048714"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048714"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">String -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048714"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span id="local-6989586621679048712"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048712"><span class="hs-identifier hs-var">sl</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">AnnotDetails a -&gt; Doc a -&gt; Doc a
forall a. AnnotDetails a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#textBeside_"><span class="hs-identifier hs-var">textBeside_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TextDetails -&gt; Int -&gt; AnnotDetails a
forall a. TextDetails -&gt; Int -&gt; AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoAnnot"><span class="hs-identifier hs-var">NoAnnot</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; TextDetails
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Str"><span class="hs-identifier hs-var">Str</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048714"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048712"><span class="hs-identifier hs-var">sl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span class="hs-special">}</span><span>
</span><span id="line-349"></span><span>
</span><span id="line-350"></span><span class="hs-comment">-- | Same as @text@. Used to be used for Bytestrings.</span><span>
</span><span id="line-351"></span><span id="local-6989586621679048711"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#ptext"><span class="hs-identifier hs-type">ptext</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048711"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-352"></span><span id="ptext"><span class="annot"><span class="annottext">ptext :: forall a. String -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#ptext"><span class="hs-identifier hs-var hs-var">ptext</span></a></span></span><span> </span><span id="local-6989586621679048709"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048709"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">String -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048709"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span id="local-6989586621679048708"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048708"><span class="hs-identifier hs-var">sl</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">AnnotDetails a -&gt; Doc a -&gt; Doc a
forall a. AnnotDetails a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#textBeside_"><span class="hs-identifier hs-var">textBeside_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TextDetails -&gt; Int -&gt; AnnotDetails a
forall a. TextDetails -&gt; Int -&gt; AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoAnnot"><span class="hs-identifier hs-var">NoAnnot</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; TextDetails
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#PStr"><span class="hs-identifier hs-var">PStr</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048709"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048708"><span class="hs-identifier hs-var">sl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span class="hs-special">}</span><span>
</span><span id="line-353"></span><span>
</span><span id="line-354"></span><span class="hs-comment">-- | Some text with any width. (@text s = sizedText (length s) s@)</span><span>
</span><span id="line-355"></span><span id="local-6989586621679049218"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sizedText"><span class="hs-identifier hs-type">sizedText</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049218"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-356"></span><span id="sizedText"><span class="annot"><span class="annottext">sizedText :: forall a. Int -&gt; String -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sizedText"><span class="hs-identifier hs-var hs-var">sizedText</span></a></span></span><span> </span><span id="local-6989586621679048707"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048707"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679048706"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048706"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotDetails a -&gt; RDoc a -&gt; RDoc a
forall a. AnnotDetails a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#textBeside_"><span class="hs-identifier hs-var">textBeside_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TextDetails -&gt; Int -&gt; AnnotDetails a
forall a. TextDetails -&gt; Int -&gt; AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoAnnot"><span class="hs-identifier hs-var">NoAnnot</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; TextDetails
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Str"><span class="hs-identifier hs-var">Str</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048706"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048707"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">RDoc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-357"></span><span>
</span><span id="line-358"></span><span class="hs-comment">-- | Some text, but without any width. Use for non-printing text</span><span>
</span><span id="line-359"></span><span class="hs-comment">-- such as a HTML or Latex tags</span><span>
</span><span id="line-360"></span><span id="local-6989586621679048705"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#zeroWidthText"><span class="hs-identifier hs-type">zeroWidthText</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048705"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-361"></span><span id="zeroWidthText"><span class="annot"><span class="annottext">zeroWidthText :: forall a. String -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#zeroWidthText"><span class="hs-identifier hs-var hs-var">zeroWidthText</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; String -&gt; Doc a
forall a. Int -&gt; String -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sizedText"><span class="hs-identifier hs-var">sizedText</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-362"></span><span>
</span><span id="line-363"></span><span class="hs-comment">-- | The empty document, with no height and no width.</span><span>
</span><span id="line-364"></span><span class="hs-comment">-- 'empty' is the identity for '&lt;&gt;', '&lt;+&gt;', '$$' and '$+$', and anywhere</span><span>
</span><span id="line-365"></span><span class="hs-comment">-- in the argument list for 'sep', 'hcat', 'hsep', 'vcat', 'fcat' etc.</span><span>
</span><span id="line-366"></span><span id="local-6989586621679048704"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#empty"><span class="hs-identifier hs-type">empty</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048704"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-367"></span><span id="empty"><span class="annot"><span class="annottext">empty :: forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#empty"><span class="hs-identifier hs-var hs-var">empty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-368"></span><span>
</span><span id="line-369"></span><span class="hs-comment">-- | Returns 'True' if the document is empty</span><span>
</span><span id="line-370"></span><span id="local-6989586621679049214"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#isEmpty"><span class="hs-identifier hs-type">isEmpty</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049214"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span></span><span>
</span><span id="line-371"></span><span id="isEmpty"><span class="annot"><span class="annottext">isEmpty :: forall a. Doc a -&gt; Bool
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#isEmpty"><span class="hs-identifier hs-var hs-var">isEmpty</span></a></span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span>
</span><span id="line-372"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#isEmpty"><span class="hs-identifier hs-var">isEmpty</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><span class="hs-identifier">_</span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span>
</span><span id="line-373"></span><span>
</span><span id="line-374"></span><span class="hs-comment">-- | Produce spacing for indenting the amount specified.</span><span>
</span><span id="line-375"></span><span class="hs-comment">--</span><span>
</span><span id="line-376"></span><span class="hs-comment">-- an old version inserted tabs being 8 columns apart in the output.</span><span>
</span><span id="line-377"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#indent"><span class="hs-identifier hs-type">indent</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-378"></span><span id="indent"><span class="annot"><span class="annottext">indent :: Int -&gt; String
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#indent"><span class="hs-identifier hs-var hs-var">indent</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679048702"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048702"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Char -&gt; String
forall a. Int -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048702"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span>
</span><span id="line-379"></span><span>
</span><span id="line-380"></span><span class="hs-comment">{-
Q: What is the reason for negative indentation (i.e. argument to indent
   is &lt; 0) ?

A:
This indicates an error in the library client's code.
If we compose a &lt;&gt; b, and the first line of b is more indented than some
other lines of b, the law &lt;n6&gt; (&lt;&gt; eats nests) may cause the pretty
printer to produce an invalid layout:

doc       |0123345
------------------
d1        |a...|
d2        |...b|
          |c...|

d1&lt;&gt;d2    |ab..|
         c|....|

Consider a &lt;&gt; b, let `s' be the length of the last line of `a', `k' the
indentation of the first line of b, and `k0' the indentation of the
left-most line b_i of b.

The produced layout will have negative indentation if `k - k0 &gt; s', as
the first line of b will be put on the (s+1)th column, effectively
translating b horizontally by (k-s). Now if the i^th line of b has an
indentation k0 &lt; (k-s), it is translated out-of-page, causing
`negative indentation'.
-}</span><span>
</span><span id="line-409"></span><span>
</span><span id="line-410"></span><span>
</span><span id="line-411"></span><span id="local-6989586621679048700"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#semi"><span class="hs-identifier hs-type">semi</span></a></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048700"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-comment">-- ^ A ';' character</span><span>
</span><span id="line-412"></span><span id="local-6989586621679048699"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#comma"><span class="hs-identifier hs-type">comma</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048699"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-comment">-- ^ A ',' character</span><span>
</span><span id="line-413"></span><span id="local-6989586621679048698"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#colon"><span class="hs-identifier hs-type">colon</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048698"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-comment">-- ^ A ':' character</span><span>
</span><span id="line-414"></span><span id="local-6989586621679048697"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#space"><span class="hs-identifier hs-type">space</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048697"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-comment">-- ^ A space character</span><span>
</span><span id="line-415"></span><span id="local-6989586621679048696"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#equals"><span class="hs-identifier hs-type">equals</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048696"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-comment">-- ^ A '=' character</span><span>
</span><span id="line-416"></span><span id="local-6989586621679048695"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#lparen"><span class="hs-identifier hs-type">lparen</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048695"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-comment">-- ^ A '(' character</span><span>
</span><span id="line-417"></span><span id="local-6989586621679048694"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#rparen"><span class="hs-identifier hs-type">rparen</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048694"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-comment">-- ^ A ')' character</span><span>
</span><span id="line-418"></span><span id="local-6989586621679048693"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#lbrack"><span class="hs-identifier hs-type">lbrack</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048693"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-comment">-- ^ A '[' character</span><span>
</span><span id="line-419"></span><span id="local-6989586621679048692"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#rbrack"><span class="hs-identifier hs-type">rbrack</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048692"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-comment">-- ^ A ']' character</span><span>
</span><span id="line-420"></span><span id="local-6989586621679048691"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#lbrace"><span class="hs-identifier hs-type">lbrace</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048691"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-comment">-- ^ A '{' character</span><span>
</span><span id="line-421"></span><span id="local-6989586621679048690"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#rbrace"><span class="hs-identifier hs-type">rbrace</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048690"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-comment">-- ^ A '}' character</span><span>
</span><span id="line-422"></span><span id="semi"><span class="annot"><span class="annottext">semi :: forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#semi"><span class="hs-identifier hs-var hs-var">semi</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc a
forall a. Char -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">';'</span></span><span>
</span><span id="line-423"></span><span id="comma"><span class="annot"><span class="annottext">comma :: forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#comma"><span class="hs-identifier hs-var hs-var">comma</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc a
forall a. Char -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">','</span></span><span>
</span><span id="line-424"></span><span id="colon"><span class="annot"><span class="annottext">colon :: forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#colon"><span class="hs-identifier hs-var hs-var">colon</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc a
forall a. Char -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">':'</span></span><span>
</span><span id="line-425"></span><span id="space"><span class="annot"><span class="annottext">space :: forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#space"><span class="hs-identifier hs-var hs-var">space</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc a
forall a. Char -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span>
</span><span id="line-426"></span><span id="equals"><span class="annot"><span class="annottext">equals :: forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#equals"><span class="hs-identifier hs-var hs-var">equals</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc a
forall a. Char -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'='</span></span><span>
</span><span id="line-427"></span><span id="lparen"><span class="annot"><span class="annottext">lparen :: forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#lparen"><span class="hs-identifier hs-var hs-var">lparen</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc a
forall a. Char -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'('</span></span><span>
</span><span id="line-428"></span><span id="rparen"><span class="annot"><span class="annottext">rparen :: forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#rparen"><span class="hs-identifier hs-var hs-var">rparen</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc a
forall a. Char -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">')'</span></span><span>
</span><span id="line-429"></span><span id="lbrack"><span class="annot"><span class="annottext">lbrack :: forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#lbrack"><span class="hs-identifier hs-var hs-var">lbrack</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc a
forall a. Char -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'['</span></span><span>
</span><span id="line-430"></span><span id="rbrack"><span class="annot"><span class="annottext">rbrack :: forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#rbrack"><span class="hs-identifier hs-var hs-var">rbrack</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc a
forall a. Char -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">']'</span></span><span>
</span><span id="line-431"></span><span id="lbrace"><span class="annot"><span class="annottext">lbrace :: forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#lbrace"><span class="hs-identifier hs-var hs-var">lbrace</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc a
forall a. Char -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'{'</span></span><span>
</span><span id="line-432"></span><span id="rbrace"><span class="annot"><span class="annottext">rbrace :: forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#rbrace"><span class="hs-identifier hs-var hs-var">rbrace</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc a
forall a. Char -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'}'</span></span><span>
</span><span id="line-433"></span><span>
</span><span id="line-434"></span><span id="local-6989586621679048689"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#spaceText"><span class="hs-identifier hs-type">spaceText</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nlText"><span class="hs-identifier hs-type">nlText</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotDetails"><span class="hs-identifier hs-type">AnnotDetails</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048689"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-435"></span><span id="spaceText"><span class="annot"><span class="annottext">spaceText :: forall a. AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#spaceText"><span class="hs-identifier hs-var hs-var">spaceText</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TextDetails -&gt; Int -&gt; AnnotDetails a
forall a. TextDetails -&gt; Int -&gt; AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoAnnot"><span class="hs-identifier hs-var">NoAnnot</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; TextDetails
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Chr"><span class="hs-identifier hs-var">Chr</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-436"></span><span id="nlText"><span class="annot"><span class="annottext">nlText :: forall a. AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nlText"><span class="hs-identifier hs-var hs-var">nlText</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TextDetails -&gt; Int -&gt; AnnotDetails a
forall a. TextDetails -&gt; Int -&gt; AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoAnnot"><span class="hs-identifier hs-var">NoAnnot</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; TextDetails
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Chr"><span class="hs-identifier hs-var">Chr</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\n'</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-437"></span><span>
</span><span id="line-438"></span><span id="local-6989586621679049198"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#int"><span class="hs-identifier hs-type">int</span></a></span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049198"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-comment">-- ^ @int n = text (show n)@</span><span>
</span><span id="line-439"></span><span id="local-6989586621679049196"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#integer"><span class="hs-identifier hs-type">integer</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Integer</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049196"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-comment">-- ^ @integer n = text (show n)@</span><span>
</span><span id="line-440"></span><span id="local-6989586621679049194"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#float"><span class="hs-identifier hs-type">float</span></a></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Float"><span class="hs-identifier hs-type">Float</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049194"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-comment">-- ^ @float n = text (show n)@</span><span>
</span><span id="line-441"></span><span id="local-6989586621679049192"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#double"><span class="hs-identifier hs-type">double</span></a></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Double"><span class="hs-identifier hs-type">Double</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049192"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-comment">-- ^ @double n = text (show n)@</span><span>
</span><span id="line-442"></span><span id="local-6989586621679049190"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#rational"><span class="hs-identifier hs-type">rational</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Real.html#Rational"><span class="hs-identifier hs-type">Rational</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049190"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-comment">-- ^ @rational n = text (show n)@</span><span>
</span><span id="line-443"></span><span id="int"><span class="annot"><span class="annottext">int :: forall a. Int -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#int"><span class="hs-identifier hs-var hs-var">int</span></a></span></span><span>      </span><span id="local-6989586621679048685"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048685"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Doc a
forall a. String -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048685"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-444"></span><span id="integer"><span class="annot"><span class="annottext">integer :: forall a. Integer -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#integer"><span class="hs-identifier hs-var hs-var">integer</span></a></span></span><span>  </span><span id="local-6989586621679048681"><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679048681"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Doc a
forall a. String -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Integer -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><a href="#local-6989586621679048681"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-445"></span><span id="float"><span class="annot"><span class="annottext">float :: forall a. Float -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#float"><span class="hs-identifier hs-var hs-var">float</span></a></span></span><span>    </span><span id="local-6989586621679048678"><span class="annot"><span class="annottext">Float
</span><a href="#local-6989586621679048678"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Doc a
forall a. String -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Float -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Float
</span><a href="#local-6989586621679048678"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-446"></span><span id="double"><span class="annot"><span class="annottext">double :: forall a. Double -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#double"><span class="hs-identifier hs-var hs-var">double</span></a></span></span><span>   </span><span id="local-6989586621679048675"><span class="annot"><span class="annottext">Double
</span><a href="#local-6989586621679048675"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Doc a
forall a. String -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Double -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Double
</span><a href="#local-6989586621679048675"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-447"></span><span id="rational"><span class="annot"><span class="annottext">rational :: forall a. Rational -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#rational"><span class="hs-identifier hs-var hs-var">rational</span></a></span></span><span> </span><span id="local-6989586621679048671"><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621679048671"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Doc a
forall a. String -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Rational -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Rational
</span><a href="#local-6989586621679048671"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-448"></span><span>
</span><span id="line-449"></span><span id="local-6989586621679048670"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#parens"><span class="hs-identifier hs-type">parens</span></a></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048670"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048670"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-comment">-- ^ Wrap document in @(...)@</span><span>
</span><span id="line-450"></span><span id="local-6989586621679048669"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#brackets"><span class="hs-identifier hs-type">brackets</span></a></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048669"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048669"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-comment">-- ^ Wrap document in @[...]@</span><span>
</span><span id="line-451"></span><span id="local-6989586621679048668"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#braces"><span class="hs-identifier hs-type">braces</span></a></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048668"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048668"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-comment">-- ^ Wrap document in @{...}@</span><span>
</span><span id="line-452"></span><span id="local-6989586621679048667"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#quotes"><span class="hs-identifier hs-type">quotes</span></a></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048667"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048667"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-comment">-- ^ Wrap document in @\'...\'@</span><span>
</span><span id="line-453"></span><span id="local-6989586621679048666"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#doubleQuotes"><span class="hs-identifier hs-type">doubleQuotes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048666"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048666"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-comment">-- ^ Wrap document in @\&quot;...\&quot;@</span><span>
</span><span id="line-454"></span><span id="quotes"><span class="annot"><span class="annottext">quotes :: forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#quotes"><span class="hs-identifier hs-var hs-var">quotes</span></a></span></span><span> </span><span id="local-6989586621679048665"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048665"><span class="hs-identifier hs-var">p</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc a
forall a. Char -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\''</span></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048665"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc a
forall a. Char -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\''</span></span><span>
</span><span id="line-455"></span><span id="doubleQuotes"><span class="annot"><span class="annottext">doubleQuotes :: forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#doubleQuotes"><span class="hs-identifier hs-var hs-var">doubleQuotes</span></a></span></span><span> </span><span id="local-6989586621679048664"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048664"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc a
forall a. Char -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'&quot;'</span></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048664"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc a
forall a. Char -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'&quot;'</span></span><span>
</span><span id="line-456"></span><span id="parens"><span class="annot"><span class="annottext">parens :: forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#parens"><span class="hs-identifier hs-var hs-var">parens</span></a></span></span><span> </span><span id="local-6989586621679048663"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048663"><span class="hs-identifier hs-var">p</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc a
forall a. Char -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'('</span></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048663"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc a
forall a. Char -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">')'</span></span><span>
</span><span id="line-457"></span><span id="brackets"><span class="annot"><span class="annottext">brackets :: forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#brackets"><span class="hs-identifier hs-var hs-var">brackets</span></a></span></span><span> </span><span id="local-6989586621679048662"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048662"><span class="hs-identifier hs-var">p</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc a
forall a. Char -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'['</span></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048662"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc a
forall a. Char -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">']'</span></span><span>
</span><span id="line-458"></span><span id="braces"><span class="annot"><span class="annottext">braces :: forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#braces"><span class="hs-identifier hs-var hs-var">braces</span></a></span></span><span> </span><span id="local-6989586621679048661"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048661"><span class="hs-identifier hs-var">p</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc a
forall a. Char -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'{'</span></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048661"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Doc a
forall a. Char -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#char"><span class="hs-identifier hs-var">char</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'}'</span></span><span>
</span><span id="line-459"></span><span>
</span><span id="line-460"></span><span class="hs-comment">-- | Apply 'parens' to 'Doc' if boolean is true.</span><span>
</span><span id="line-461"></span><span id="local-6989586621679049182"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#maybeParens"><span class="hs-identifier hs-type">maybeParens</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049182"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049182"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-462"></span><span id="maybeParens"><span class="annot"><span class="annottext">maybeParens :: forall a. Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#maybeParens"><span class="hs-identifier hs-var hs-var">maybeParens</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-463"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#maybeParens"><span class="hs-identifier hs-var">maybeParens</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#parens"><span class="hs-identifier hs-var">parens</span></a></span><span>
</span><span id="line-464"></span><span>
</span><span id="line-465"></span><span class="hs-comment">-- | Apply 'brackets' to 'Doc' if boolean is true.</span><span>
</span><span id="line-466"></span><span id="local-6989586621679048659"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#maybeBrackets"><span class="hs-identifier hs-type">maybeBrackets</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048659"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048659"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-467"></span><span id="maybeBrackets"><span class="annot"><span class="annottext">maybeBrackets :: forall a. Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#maybeBrackets"><span class="hs-identifier hs-var hs-var">maybeBrackets</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-468"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#maybeBrackets"><span class="hs-identifier hs-var">maybeBrackets</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#brackets"><span class="hs-identifier hs-var">brackets</span></a></span><span>
</span><span id="line-469"></span><span>
</span><span id="line-470"></span><span class="hs-comment">-- | Apply 'braces' to 'Doc' if boolean is true.</span><span>
</span><span id="line-471"></span><span id="local-6989586621679048658"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#maybeBraces"><span class="hs-identifier hs-type">maybeBraces</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048658"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048658"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-472"></span><span id="maybeBraces"><span class="annot"><span class="annottext">maybeBraces :: forall a. Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#maybeBraces"><span class="hs-identifier hs-var hs-var">maybeBraces</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-473"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#maybeBraces"><span class="hs-identifier hs-var">maybeBraces</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#braces"><span class="hs-identifier hs-var">braces</span></a></span><span>
</span><span id="line-474"></span><span>
</span><span id="line-475"></span><span class="hs-comment">-- | Apply 'quotes' to 'Doc' if boolean is true.</span><span>
</span><span id="line-476"></span><span id="local-6989586621679048657"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#maybeQuotes"><span class="hs-identifier hs-type">maybeQuotes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048657"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048657"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-477"></span><span id="maybeQuotes"><span class="annot"><span class="annottext">maybeQuotes :: forall a. Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#maybeQuotes"><span class="hs-identifier hs-var hs-var">maybeQuotes</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-478"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#maybeQuotes"><span class="hs-identifier hs-var">maybeQuotes</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span>
</span><span id="line-479"></span><span>
</span><span id="line-480"></span><span class="hs-comment">-- | Apply 'doubleQuotes' to 'Doc' if boolean is true.</span><span>
</span><span id="line-481"></span><span id="local-6989586621679048656"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#maybeDoubleQuotes"><span class="hs-identifier hs-type">maybeDoubleQuotes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048656"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048656"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-482"></span><span id="maybeDoubleQuotes"><span class="annot"><span class="annottext">maybeDoubleQuotes :: forall a. Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#maybeDoubleQuotes"><span class="hs-identifier hs-var hs-var">maybeDoubleQuotes</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-483"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#maybeDoubleQuotes"><span class="hs-identifier hs-var">maybeDoubleQuotes</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#doubleQuotes"><span class="hs-identifier hs-var">doubleQuotes</span></a></span><span>
</span><span id="line-484"></span><span>
</span><span id="line-485"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-486"></span><span class="hs-comment">-- Structural operations on GDocs</span><span>
</span><span id="line-487"></span><span>
</span><span id="line-488"></span><span class="hs-comment">-- | Perform some simplification of a built up @GDoc@.</span><span>
</span><span id="line-489"></span><span id="local-6989586621679048655"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-type">reduceDoc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048655"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048655"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-490"></span><span id="reduceDoc"><span class="annot"><span class="annottext">reduceDoc :: forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var hs-var">reduceDoc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Beside"><span class="hs-identifier hs-type">Beside</span></a></span><span> </span><span id="local-6989586621679048654"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048654"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679048653"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048653"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679048652"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048652"><span class="hs-identifier hs-var">q</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside"><span class="hs-identifier hs-var">beside</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048654"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048653"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var">reduceDoc</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048652"><span class="hs-identifier hs-var">q</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-491"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var">reduceDoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Above"><span class="hs-identifier hs-type">Above</span></a></span><span>  </span><span id="local-6989586621679048651"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048651"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679048650"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048650"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679048649"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048649"><span class="hs-identifier hs-var">q</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#above"><span class="hs-identifier hs-var">above</span></a></span><span>  </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048651"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048650"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var">reduceDoc</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048649"><span class="hs-identifier hs-var">q</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-492"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var">reduceDoc</span></a></span><span> </span><span id="local-6989586621679048647"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048647"><span class="hs-identifier hs-var">p</span></a></span></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048647"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-493"></span><span>
</span><span id="line-494"></span><span class="hs-comment">-- | List version of '&lt;&gt;'.</span><span>
</span><span id="line-495"></span><span id="local-6989586621679048646"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#hcat"><span class="hs-identifier hs-type">hcat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048646"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048646"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-496"></span><span id="hcat"><span class="annot"><span class="annottext">hcat :: forall a. [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#hcat"><span class="hs-identifier hs-var hs-var">hcat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(IsEmpty, Doc a) -&gt; Doc a
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="annot"><span class="annottext">((IsEmpty, Doc a) -&gt; Doc a)
-&gt; ([Doc a] -&gt; (IsEmpty, Doc a)) -&gt; [Doc a] -&gt; Doc a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; (IsEmpty, Doc a)
forall a. Doc a -&gt; (IsEmpty, Doc a)
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceHoriz"><span class="hs-identifier hs-var">reduceHoriz</span></a></span><span> </span><span class="annot"><span class="annottext">(Doc a -&gt; (IsEmpty, Doc a))
-&gt; ([Doc a] -&gt; Doc a) -&gt; [Doc a] -&gt; (IsEmpty, Doc a)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Doc a -&gt; Doc a -&gt; Doc a) -&gt; Doc a -&gt; [Doc a] -&gt; Doc a
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679048641"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048641"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679048640"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048640"><span class="hs-identifier hs-var">q</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Beside"><span class="hs-identifier hs-var">Beside</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048641"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048640"><span class="hs-identifier hs-var">q</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-497"></span><span>
</span><span id="line-498"></span><span class="hs-comment">-- | List version of '&lt;+&gt;'.</span><span>
</span><span id="line-499"></span><span id="local-6989586621679048639"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#hsep"><span class="hs-identifier hs-type">hsep</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048639"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048639"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-500"></span><span id="hsep"><span class="annot"><span class="annottext">hsep :: forall a. [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#hsep"><span class="hs-identifier hs-var hs-var">hsep</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(IsEmpty, Doc a) -&gt; Doc a
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="annot"><span class="annottext">((IsEmpty, Doc a) -&gt; Doc a)
-&gt; ([Doc a] -&gt; (IsEmpty, Doc a)) -&gt; [Doc a] -&gt; Doc a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; (IsEmpty, Doc a)
forall a. Doc a -&gt; (IsEmpty, Doc a)
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceHoriz"><span class="hs-identifier hs-var">reduceHoriz</span></a></span><span> </span><span class="annot"><span class="annottext">(Doc a -&gt; (IsEmpty, Doc a))
-&gt; ([Doc a] -&gt; Doc a) -&gt; [Doc a] -&gt; (IsEmpty, Doc a)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Doc a -&gt; Doc a -&gt; Doc a) -&gt; Doc a -&gt; [Doc a] -&gt; Doc a
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679048637"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048637"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679048636"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048636"><span class="hs-identifier hs-var">q</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Beside"><span class="hs-identifier hs-var">Beside</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048637"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048636"><span class="hs-identifier hs-var">q</span></a></span><span class="hs-special">)</span><span>  </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-501"></span><span>
</span><span id="line-502"></span><span class="hs-comment">-- | List version of '$$'.</span><span>
</span><span id="line-503"></span><span id="local-6989586621679048635"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#vcat"><span class="hs-identifier hs-type">vcat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048635"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048635"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-504"></span><span id="vcat"><span class="annot"><span class="annottext">vcat :: forall a. [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#vcat"><span class="hs-identifier hs-var hs-var">vcat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(IsEmpty, Doc a) -&gt; Doc a
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="annot"><span class="annottext">((IsEmpty, Doc a) -&gt; Doc a)
-&gt; ([Doc a] -&gt; (IsEmpty, Doc a)) -&gt; [Doc a] -&gt; Doc a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; (IsEmpty, Doc a)
forall a. Doc a -&gt; (IsEmpty, Doc a)
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceVert"><span class="hs-identifier hs-var">reduceVert</span></a></span><span> </span><span class="annot"><span class="annottext">(Doc a -&gt; (IsEmpty, Doc a))
-&gt; ([Doc a] -&gt; Doc a) -&gt; [Doc a] -&gt; (IsEmpty, Doc a)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Doc a -&gt; Doc a -&gt; Doc a) -&gt; Doc a -&gt; [Doc a] -&gt; Doc a
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679048632"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048632"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679048631"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048631"><span class="hs-identifier hs-var">q</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Above"><span class="hs-identifier hs-var">Above</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048632"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048631"><span class="hs-identifier hs-var">q</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-505"></span><span>
</span><span id="line-506"></span><span class="hs-comment">-- | Nest (or indent) a document by a given number of positions</span><span>
</span><span id="line-507"></span><span class="hs-comment">-- (which may also be negative).  'nest' satisfies the laws:</span><span>
</span><span id="line-508"></span><span class="hs-comment">--</span><span>
</span><span id="line-509"></span><span class="hs-comment">-- * @'nest' 0 x = x@</span><span>
</span><span id="line-510"></span><span class="hs-comment">--</span><span>
</span><span id="line-511"></span><span class="hs-comment">-- * @'nest' k ('nest' k' x) = 'nest' (k+k') x@</span><span>
</span><span id="line-512"></span><span class="hs-comment">--</span><span>
</span><span id="line-513"></span><span class="hs-comment">-- * @'nest' k (x '&lt;&gt;' y) = 'nest' k z '&lt;&gt;' 'nest' k y@</span><span>
</span><span id="line-514"></span><span class="hs-comment">--</span><span>
</span><span id="line-515"></span><span class="hs-comment">-- * @'nest' k (x '$$' y) = 'nest' k x '$$' 'nest' k y@</span><span>
</span><span id="line-516"></span><span class="hs-comment">--</span><span>
</span><span id="line-517"></span><span class="hs-comment">-- * @'nest' k 'empty' = 'empty'@</span><span>
</span><span id="line-518"></span><span class="hs-comment">--</span><span>
</span><span id="line-519"></span><span class="hs-comment">-- * @x '&lt;&gt;' 'nest' k y = x '&lt;&gt;' y@, if @x@ non-empty</span><span>
</span><span id="line-520"></span><span class="hs-comment">--</span><span>
</span><span id="line-521"></span><span class="hs-comment">-- The side condition on the last law is needed because</span><span>
</span><span id="line-522"></span><span class="hs-comment">-- 'empty' is a left identity for '&lt;&gt;'.</span><span>
</span><span id="line-523"></span><span id="local-6989586621679048630"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nest"><span class="hs-identifier hs-type">nest</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048630"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048630"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-524"></span><span id="nest"><span class="annot"><span class="annottext">nest :: forall a. Int -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nest"><span class="hs-identifier hs-var hs-var">nest</span></a></span></span><span> </span><span id="local-6989586621679048629"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048629"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048628"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048628"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Doc a -&gt; Doc a
forall a. Int -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mkNest"><span class="hs-identifier hs-var">mkNest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048629"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var">reduceDoc</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048628"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-525"></span><span>
</span><span id="line-526"></span><span class="hs-comment">-- | @hang d1 n d2 = sep [d1, nest n d2]@</span><span>
</span><span id="line-527"></span><span id="local-6989586621679049161"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#hang"><span class="hs-identifier hs-type">hang</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049161"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049161"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049161"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-528"></span><span id="hang"><span class="annot"><span class="annottext">hang :: forall a. Doc a -&gt; Int -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#hang"><span class="hs-identifier hs-var hs-var">hang</span></a></span></span><span> </span><span id="local-6989586621679048626"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048626"><span class="hs-identifier hs-var">d1</span></a></span></span><span> </span><span id="local-6989586621679048625"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048625"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679048624"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048624"><span class="hs-identifier hs-var">d2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Doc a] -&gt; Doc a
forall a. [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sep"><span class="hs-identifier hs-var">sep</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048626"><span class="hs-identifier hs-var">d1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Doc a -&gt; Doc a
forall a. Int -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nest"><span class="hs-identifier hs-var">nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048625"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048624"><span class="hs-identifier hs-var">d2</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-529"></span><span>
</span><span id="line-530"></span><span class="hs-comment">-- | @punctuate p [d1, ... dn] = [d1 \&lt;&gt; p, d2 \&lt;&gt; p, ... dn-1 \&lt;&gt; p, dn]@</span><span>
</span><span id="line-531"></span><span id="local-6989586621679049159"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#punctuate"><span class="hs-identifier hs-type">punctuate</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049159"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049159"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049159"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span>
</span><span id="line-532"></span><span id="punctuate"><span class="annot"><span class="annottext">punctuate :: forall a. Doc a -&gt; [Doc a] -&gt; [Doc a]
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#punctuate"><span class="hs-identifier hs-var hs-var">punctuate</span></a></span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-533"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#punctuate"><span class="hs-identifier hs-var">punctuate</span></a></span><span> </span><span id="local-6989586621679048623"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048623"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679048622"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048622"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679048621"><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048621"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; [Doc a] -&gt; [Doc a]
</span><a href="#local-6989586621679048620"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048622"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048621"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-534"></span><span>                   </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679048620"><span class="annot"><span class="annottext">go :: Doc a -&gt; [Doc a] -&gt; [Doc a]
</span><a href="#local-6989586621679048620"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679048619"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048619"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048619"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-535"></span><span>                         </span><span class="annot"><a href="#local-6989586621679048620"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621679048618"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048618"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679048617"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048617"><span class="hs-identifier hs-var">z</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679048616"><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048616"><span class="hs-identifier hs-var">zs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048618"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048623"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; [Doc a] -&gt; [Doc a]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; [Doc a] -&gt; [Doc a]
</span><a href="#local-6989586621679048620"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048617"><span class="hs-identifier hs-var">z</span></a></span><span> </span><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048616"><span class="hs-identifier hs-var">zs</span></a></span><span>
</span><span id="line-536"></span><span>
</span><span id="line-537"></span><span class="hs-comment">-- mkNest checks for Nest's invariant that it doesn't have an Empty inside it</span><span>
</span><span id="line-538"></span><span id="local-6989586621679048615"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mkNest"><span class="hs-identifier hs-type">mkNest</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048615"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048615"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-539"></span><span id="mkNest"><span class="annot"><span class="annottext">mkNest :: forall a. Int -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mkNest"><span class="hs-identifier hs-var hs-var">mkNest</span></a></span></span><span> </span><span id="local-6989586621679048608"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048608"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048608"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. HasCallStack =&gt; a
</span><a href="../../base/src/GHC.Err.html#undefined"><span class="hs-identifier hs-var">undefined</span></a></span><span>
</span><span id="line-540"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mkNest"><span class="hs-identifier hs-var">mkNest</span></a></span><span> </span><span id="local-6989586621679048606"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048606"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Nest"><span class="hs-identifier hs-type">Nest</span></a></span><span> </span><span id="local-6989586621679048605"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048605"><span class="hs-identifier hs-var">k1</span></a></span></span><span> </span><span id="local-6989586621679048604"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048604"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Doc a -&gt; Doc a
forall a. Int -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mkNest"><span class="hs-identifier hs-var">mkNest</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048606"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048605"><span class="hs-identifier hs-var">k1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048604"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-541"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mkNest"><span class="hs-identifier hs-var">mkNest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>
</span><span id="line-542"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mkNest"><span class="hs-identifier hs-var">mkNest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-543"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mkNest"><span class="hs-identifier hs-var">mkNest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span id="local-6989586621679048602"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048602"><span class="hs-identifier hs-var">p</span></a></span></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048602"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-544"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mkNest"><span class="hs-identifier hs-var">mkNest</span></a></span><span> </span><span id="local-6989586621679048601"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048601"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048600"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048600"><span class="hs-identifier hs-var">p</span></a></span></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Doc a -&gt; Doc a
forall a. Int -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nest_"><span class="hs-identifier hs-var">nest_</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048601"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048600"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-545"></span><span>
</span><span id="line-546"></span><span class="hs-comment">-- mkUnion checks for an empty document</span><span>
</span><span id="line-547"></span><span id="local-6989586621679048598"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mkUnion"><span class="hs-identifier hs-type">mkUnion</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048598"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048598"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048598"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-548"></span><span id="mkUnion"><span class="annot"><span class="annottext">mkUnion :: forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mkUnion"><span class="hs-identifier hs-var hs-var">mkUnion</span></a></span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-549"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mkUnion"><span class="hs-identifier hs-var">mkUnion</span></a></span><span> </span><span id="local-6989586621679048596"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048596"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679048595"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048595"><span class="hs-identifier hs-var">q</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048596"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#union_"><span class="hs-operator hs-var">`union_`</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048595"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-550"></span><span>
</span><span id="line-551"></span><span class="hs-keyword">data</span><span> </span><span id="IsEmpty"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#IsEmpty"><span class="hs-identifier hs-var">IsEmpty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="IsEmpty"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#IsEmpty"><span class="hs-identifier hs-var">IsEmpty</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="NotEmpty"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NotEmpty"><span class="hs-identifier hs-var">NotEmpty</span></a></span></span><span>
</span><span id="line-552"></span><span>
</span><span id="line-553"></span><span id="local-6989586621679049167"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceHoriz"><span class="hs-identifier hs-type">reduceHoriz</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049167"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#IsEmpty"><span class="hs-identifier hs-type">IsEmpty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049167"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-554"></span><span id="reduceHoriz"><span class="annot"><span class="annottext">reduceHoriz :: forall a. Doc a -&gt; (IsEmpty, Doc a)
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceHoriz"><span class="hs-identifier hs-var hs-var">reduceHoriz</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Beside"><span class="hs-identifier hs-type">Beside</span></a></span><span> </span><span id="local-6989586621679048591"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048591"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679048590"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048590"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679048589"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048589"><span class="hs-identifier hs-var">q</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a)
-&gt; Doc a -&gt; Bool -&gt; (IsEmpty, Doc a) -&gt; (IsEmpty, Doc a)
forall a.
(Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a)
-&gt; Doc a -&gt; Bool -&gt; (IsEmpty, Doc a) -&gt; (IsEmpty, Doc a)
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#eliminateEmpty"><span class="hs-identifier hs-var">eliminateEmpty</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Beside"><span class="hs-identifier hs-var">Beside</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(IsEmpty, Doc a) -&gt; Doc a
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a -&gt; (IsEmpty, Doc a)
forall a. Doc a -&gt; (IsEmpty, Doc a)
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceHoriz"><span class="hs-identifier hs-var">reduceHoriz</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048591"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048590"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a -&gt; (IsEmpty, Doc a)
forall a. Doc a -&gt; (IsEmpty, Doc a)
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceHoriz"><span class="hs-identifier hs-var">reduceHoriz</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048589"><span class="hs-identifier hs-var">q</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-555"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceHoriz"><span class="hs-identifier hs-var">reduceHoriz</span></a></span><span> </span><span id="local-6989586621679048587"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048587"><span class="hs-identifier hs-var">doc</span></a></span></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IsEmpty
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NotEmpty"><span class="hs-identifier hs-var">NotEmpty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048587"><span class="hs-identifier hs-var">doc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-556"></span><span>
</span><span id="line-557"></span><span id="local-6989586621679048586"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceVert"><span class="hs-identifier hs-type">reduceVert</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048586"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#IsEmpty"><span class="hs-identifier hs-type">IsEmpty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048586"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-558"></span><span id="reduceVert"><span class="annot"><span class="annottext">reduceVert :: forall a. Doc a -&gt; (IsEmpty, Doc a)
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceVert"><span class="hs-identifier hs-var hs-var">reduceVert</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Above"><span class="hs-identifier hs-type">Above</span></a></span><span>  </span><span id="local-6989586621679048585"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048585"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679048584"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048584"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679048583"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048583"><span class="hs-identifier hs-var">q</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a)
-&gt; Doc a -&gt; Bool -&gt; (IsEmpty, Doc a) -&gt; (IsEmpty, Doc a)
forall a.
(Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a)
-&gt; Doc a -&gt; Bool -&gt; (IsEmpty, Doc a) -&gt; (IsEmpty, Doc a)
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#eliminateEmpty"><span class="hs-identifier hs-var">eliminateEmpty</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Above"><span class="hs-identifier hs-var">Above</span></a></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(IsEmpty, Doc a) -&gt; Doc a
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a -&gt; (IsEmpty, Doc a)
forall a. Doc a -&gt; (IsEmpty, Doc a)
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceVert"><span class="hs-identifier hs-var">reduceVert</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048585"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048584"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a -&gt; (IsEmpty, Doc a)
forall a. Doc a -&gt; (IsEmpty, Doc a)
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceVert"><span class="hs-identifier hs-var">reduceVert</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048583"><span class="hs-identifier hs-var">q</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-559"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceVert"><span class="hs-identifier hs-var">reduceVert</span></a></span><span> </span><span id="local-6989586621679048582"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048582"><span class="hs-identifier hs-var">doc</span></a></span></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IsEmpty
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NotEmpty"><span class="hs-identifier hs-var">NotEmpty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048582"><span class="hs-identifier hs-var">doc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-560"></span><span>
</span><span id="line-561"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#eliminateEmpty"><span class="hs-pragma hs-type">eliminateEmpty</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-562"></span><span id="local-6989586621679049150"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#eliminateEmpty"><span class="hs-identifier hs-type">eliminateEmpty</span></a></span><span> </span><span class="hs-glyph">::</span><span>
</span><span id="line-563"></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049150"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049150"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049150"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-564"></span><span>  </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049150"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#IsEmpty"><span class="hs-identifier hs-type">IsEmpty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049150"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#IsEmpty"><span class="hs-identifier hs-type">IsEmpty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049150"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-565"></span><span id="eliminateEmpty"><span class="annot"><span class="annottext">eliminateEmpty :: forall a.
(Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a)
-&gt; Doc a -&gt; Bool -&gt; (IsEmpty, Doc a) -&gt; (IsEmpty, Doc a)
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#eliminateEmpty"><span class="hs-identifier hs-var hs-var">eliminateEmpty</span></a></span></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><span class="hs-identifier">_</span></span><span>    </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679048581"><span class="annot"><span class="annottext">(IsEmpty, Doc a)
</span><a href="#local-6989586621679048581"><span class="hs-identifier hs-var">q</span></a></span></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(IsEmpty, Doc a)
</span><a href="#local-6989586621679048581"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-566"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#eliminateEmpty"><span class="hs-identifier hs-var">eliminateEmpty</span></a></span><span> </span><span id="local-6989586621679048580"><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="#local-6989586621679048580"><span class="hs-identifier hs-var">cons</span></a></span></span><span> </span><span id="local-6989586621679048579"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048579"><span class="hs-identifier hs-var">p</span></a></span></span><span>     </span><span id="local-6989586621679048578"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048578"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679048577"><span class="annot"><span class="annottext">(IsEmpty, Doc a)
</span><a href="#local-6989586621679048577"><span class="hs-identifier hs-var">q</span></a></span></span><span>          </span><span class="hs-glyph">=</span><span>
</span><span id="line-567"></span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IsEmpty
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NotEmpty"><span class="hs-identifier hs-var">NotEmpty</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-568"></span><span>   </span><span class="hs-comment">-- We're not empty whether or not q is empty, so for laziness-sake,</span><span>
</span><span id="line-569"></span><span>   </span><span class="hs-comment">-- after checking that p isn't empty, we put the NotEmpty result</span><span>
</span><span id="line-570"></span><span>   </span><span class="hs-comment">-- outside independent of q. This allows reduceAB to immediately</span><span>
</span><span id="line-571"></span><span>   </span><span class="hs-comment">-- return the appropriate constructor (Above or Beside) without</span><span>
</span><span id="line-572"></span><span>   </span><span class="hs-comment">-- forcing the entire nested Doc. This allows the foldr in vcat,</span><span>
</span><span id="line-573"></span><span>   </span><span class="hs-comment">-- hsep, and hcat to be lazy on its second argument, avoiding a</span><span>
</span><span id="line-574"></span><span>   </span><span class="hs-comment">-- stack overflow.</span><span>
</span><span id="line-575"></span><span>   </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">(IsEmpty, Doc a)
</span><a href="#local-6989586621679048577"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-576"></span><span>     </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IsEmpty
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NotEmpty"><span class="hs-identifier hs-var">NotEmpty</span></a></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679048576"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048576"><span class="hs-identifier hs-var">q'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="#local-6989586621679048580"><span class="hs-identifier hs-var">cons</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048579"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048578"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048576"><span class="hs-identifier hs-var">q'</span></a></span><span>
</span><span id="line-577"></span><span>     </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IsEmpty
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#IsEmpty"><span class="hs-identifier hs-var">IsEmpty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048579"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-578"></span><span>
</span><span id="line-579"></span><span id="local-6989586621679048575"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilAbove_"><span class="hs-identifier hs-type">nilAbove_</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048575"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048575"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-580"></span><span id="nilAbove_"><span class="annot"><span class="annottext">nilAbove_ :: forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilAbove_"><span class="hs-identifier hs-var hs-var">nilAbove_</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NilAbove"><span class="hs-identifier hs-var">NilAbove</span></a></span><span>
</span><span id="line-581"></span><span>
</span><span id="line-582"></span><span class="hs-comment">-- | Arg of a TextBeside is always an RDoc.</span><span>
</span><span id="line-583"></span><span id="local-6989586621679048573"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#textBeside_"><span class="hs-identifier hs-type">textBeside_</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotDetails"><span class="hs-identifier hs-type">AnnotDetails</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048573"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048573"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048573"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-584"></span><span id="textBeside_"><span class="annot"><span class="annottext">textBeside_ :: forall a. AnnotDetails a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#textBeside_"><span class="hs-identifier hs-var hs-var">textBeside_</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotDetails a -&gt; Doc a -&gt; Doc a
forall a. AnnotDetails a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextBeside"><span class="hs-identifier hs-var">TextBeside</span></a></span><span>
</span><span id="line-585"></span><span>
</span><span id="line-586"></span><span id="local-6989586621679048572"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nest_"><span class="hs-identifier hs-type">nest_</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048572"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048572"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-587"></span><span id="nest_"><span class="annot"><span class="annottext">nest_ :: forall a. Int -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nest_"><span class="hs-identifier hs-var hs-var">nest_</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Doc a -&gt; Doc a
forall a. Int -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Nest"><span class="hs-identifier hs-var">Nest</span></a></span><span>
</span><span id="line-588"></span><span>
</span><span id="line-589"></span><span id="local-6989586621679048571"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#union_"><span class="hs-identifier hs-type">union_</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048571"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048571"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048571"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-590"></span><span id="union_"><span class="annot"><span class="annottext">union_ :: forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#union_"><span class="hs-identifier hs-var hs-var">union_</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Union"><span class="hs-identifier hs-var">Union</span></a></span><span>
</span><span id="line-591"></span><span>
</span><span id="line-592"></span><span>
</span><span id="line-593"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-594"></span><span class="hs-comment">-- Vertical composition @$$@</span><span>
</span><span id="line-595"></span><span>
</span><span id="line-596"></span><span class="hs-comment">-- | Above, except that if the last line of the first argument stops</span><span>
</span><span id="line-597"></span><span class="hs-comment">-- at least one position before the first line of the second begins,</span><span>
</span><span id="line-598"></span><span class="hs-comment">-- these two lines are overlapped.  For example:</span><span>
</span><span id="line-599"></span><span class="hs-comment">--</span><span>
</span><span id="line-600"></span><span class="hs-comment">-- &gt;    text &quot;hi&quot; $$ nest 5 (text &quot;there&quot;)</span><span>
</span><span id="line-601"></span><span class="hs-comment">--</span><span>
</span><span id="line-602"></span><span class="hs-comment">-- lays out as</span><span>
</span><span id="line-603"></span><span class="hs-comment">--</span><span>
</span><span id="line-604"></span><span class="hs-comment">-- &gt;    hi   there</span><span>
</span><span id="line-605"></span><span class="hs-comment">--</span><span>
</span><span id="line-606"></span><span class="hs-comment">-- rather than</span><span>
</span><span id="line-607"></span><span class="hs-comment">--</span><span>
</span><span id="line-608"></span><span class="hs-comment">-- &gt;    hi</span><span>
</span><span id="line-609"></span><span class="hs-comment">-- &gt;         there</span><span>
</span><span id="line-610"></span><span class="hs-comment">--</span><span>
</span><span id="line-611"></span><span class="hs-comment">-- '$$' is associative, with identity 'empty', and also satisfies</span><span>
</span><span id="line-612"></span><span class="hs-comment">--</span><span>
</span><span id="line-613"></span><span class="hs-comment">-- * @(x '$$' y) '&lt;&gt;' z = x '$$' (y '&lt;&gt;' z)@, if @y@ non-empty.</span><span>
</span><span id="line-614"></span><span class="hs-comment">--</span><span>
</span><span id="line-615"></span><span id="local-6989586621679048570"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%24%24"><span class="hs-operator hs-type">($$)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048570"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048570"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048570"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-616"></span><span id="local-6989586621679048569"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048569"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="%24%24"><span class="annot"><span class="annottext">$$ :: forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%24%24"><span class="hs-operator hs-var hs-var">$$</span></a></span></span><span>  </span><span id="local-6989586621679048568"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048568"><span class="hs-identifier hs-var">q</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#above_"><span class="hs-identifier hs-var">above_</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048569"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048568"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-617"></span><span>
</span><span id="line-618"></span><span class="hs-comment">-- | Above, with no overlapping.</span><span>
</span><span id="line-619"></span><span class="hs-comment">-- '$+$' is associative, with identity 'empty'.</span><span>
</span><span id="line-620"></span><span id="local-6989586621679048566"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%24%2B%24"><span class="hs-operator hs-type">($+$)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048566"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048566"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048566"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-621"></span><span id="local-6989586621679048565"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048565"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="%24%2B%24"><span class="annot"><span class="annottext">$+$ :: forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%24%2B%24"><span class="hs-operator hs-var hs-var">$+$</span></a></span></span><span> </span><span id="local-6989586621679048564"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048564"><span class="hs-identifier hs-var">q</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#above_"><span class="hs-identifier hs-var">above_</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048565"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048564"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-622"></span><span>
</span><span id="line-623"></span><span id="local-6989586621679048563"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#above_"><span class="hs-identifier hs-type">above_</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048563"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048563"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048563"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-624"></span><span id="above_"><span class="annot"><span class="annottext">above_ :: forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#above_"><span class="hs-identifier hs-var hs-var">above_</span></a></span></span><span> </span><span id="local-6989586621679048562"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048562"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048562"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-625"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#above_"><span class="hs-identifier hs-var">above_</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679048561"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048561"><span class="hs-identifier hs-var">q</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048561"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-626"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#above_"><span class="hs-identifier hs-var">above_</span></a></span><span> </span><span id="local-6989586621679048560"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048560"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679048559"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048559"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679048558"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048558"><span class="hs-identifier hs-var">q</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Above"><span class="hs-identifier hs-var">Above</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048560"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048559"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048558"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-627"></span><span>
</span><span id="line-628"></span><span id="local-6989586621679048557"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#above"><span class="hs-identifier hs-type">above</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048557"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048557"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048557"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-629"></span><span id="above"><span class="annot"><span class="annottext">above :: forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#above"><span class="hs-identifier hs-var hs-var">above</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Above"><span class="hs-identifier hs-type">Above</span></a></span><span> </span><span id="local-6989586621679048556"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048556"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679048555"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048555"><span class="hs-identifier hs-var">g1</span></a></span></span><span> </span><span id="local-6989586621679048554"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048554"><span class="hs-identifier hs-var">q1</span></a></span></span><span class="hs-special">)</span><span>  </span><span id="local-6989586621679048553"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048553"><span class="hs-identifier hs-var">g2</span></a></span></span><span> </span><span id="local-6989586621679048552"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048552"><span class="hs-identifier hs-var">q2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#above"><span class="hs-identifier hs-var">above</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048556"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048555"><span class="hs-identifier hs-var">g1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#above"><span class="hs-identifier hs-var">above</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048554"><span class="hs-identifier hs-var">q1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048553"><span class="hs-identifier hs-var">g2</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048552"><span class="hs-identifier hs-var">q2</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-630"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#above"><span class="hs-identifier hs-var">above</span></a></span><span> </span><span id="local-6989586621679048551"><span class="annot"><span class="annottext">p :: Doc a
</span><a href="#local-6989586621679048551"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Beside"><span class="hs-identifier hs-type">Beside</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>     </span><span id="local-6989586621679048550"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048550"><span class="hs-identifier hs-var">g</span></a></span></span><span>  </span><span id="local-6989586621679048549"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048549"><span class="hs-identifier hs-var">q</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Int -&gt; Doc a -&gt; Doc a
forall a. RDoc a -&gt; Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#aboveNest"><span class="hs-identifier hs-var">aboveNest</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var">reduceDoc</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048551"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048550"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var">reduceDoc</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048549"><span class="hs-identifier hs-var">q</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-631"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#above"><span class="hs-identifier hs-var">above</span></a></span><span> </span><span id="local-6989586621679048547"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048547"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679048546"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048546"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679048545"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048545"><span class="hs-identifier hs-var">q</span></a></span></span><span>                  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Int -&gt; Doc a -&gt; Doc a
forall a. RDoc a -&gt; Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#aboveNest"><span class="hs-identifier hs-var">aboveNest</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048547"><span class="hs-identifier hs-var">p</span></a></span><span>             </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048546"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var">reduceDoc</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048545"><span class="hs-identifier hs-var">q</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-632"></span><span>
</span><span id="line-633"></span><span class="hs-comment">-- Specfication: aboveNest p g k q = p $g$ (nest k q)</span><span>
</span><span id="line-634"></span><span id="local-6989586621679049139"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#aboveNest"><span class="hs-identifier hs-type">aboveNest</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049139"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049139"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049139"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-635"></span><span id="aboveNest"><span class="annot"><span class="annottext">aboveNest :: forall a. RDoc a -&gt; Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#aboveNest"><span class="hs-identifier hs-var hs-var">aboveNest</span></a></span></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><span class="hs-identifier">_</span></span><span>                   </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679048537"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048537"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048537"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RDoc a
forall a. HasCallStack =&gt; a
</span><a href="../../base/src/GHC.Err.html#undefined"><span class="hs-identifier hs-var">undefined</span></a></span><span>
</span><span id="line-636"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#aboveNest"><span class="hs-identifier hs-var">aboveNest</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>               </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RDoc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>
</span><span id="line-637"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#aboveNest"><span class="hs-identifier hs-var">aboveNest</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679048536"><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048536"><span class="hs-identifier hs-var">p1</span></a></span></span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Union"><span class="hs-operator hs-type">`Union`</span></a></span><span> </span><span id="local-6989586621679048535"><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048535"><span class="hs-identifier hs-var">p2</span></a></span></span><span class="hs-special">)</span><span>     </span><span id="local-6989586621679048534"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048534"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679048533"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048533"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048532"><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048532"><span class="hs-identifier hs-var">q</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RDoc a -&gt; Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
forall a. RDoc a -&gt; Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#aboveNest"><span class="hs-identifier hs-var">aboveNest</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048536"><span class="hs-identifier hs-var">p1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048534"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048533"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048532"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a -&gt; RDoc a -&gt; RDoc a
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#union_"><span class="hs-operator hs-var">`union_`</span></a></span><span>
</span><span id="line-638"></span><span>                                      </span><span class="annot"><span class="annottext">RDoc a -&gt; Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
forall a. RDoc a -&gt; Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#aboveNest"><span class="hs-identifier hs-var">aboveNest</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048535"><span class="hs-identifier hs-var">p2</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048534"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048533"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048532"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-639"></span><span>
</span><span id="line-640"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#aboveNest"><span class="hs-identifier hs-var">aboveNest</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>               </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679048531"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048531"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048530"><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048530"><span class="hs-identifier hs-var">q</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; RDoc a -&gt; RDoc a
forall a. Int -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mkNest"><span class="hs-identifier hs-var">mkNest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048531"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048530"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-641"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#aboveNest"><span class="hs-identifier hs-var">aboveNest</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Nest"><span class="hs-identifier hs-type">Nest</span></a></span><span> </span><span id="local-6989586621679048529"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048529"><span class="hs-identifier hs-var">k1</span></a></span></span><span> </span><span id="local-6989586621679048528"><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048528"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>         </span><span id="local-6989586621679048527"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048527"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679048526"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048526"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048525"><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048525"><span class="hs-identifier hs-var">q</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; RDoc a -&gt; RDoc a
forall a. Int -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nest_"><span class="hs-identifier hs-var">nest_</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048529"><span class="hs-identifier hs-var">k1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RDoc a -&gt; Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
forall a. RDoc a -&gt; Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#aboveNest"><span class="hs-identifier hs-var">aboveNest</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048528"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048527"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048526"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048529"><span class="hs-identifier hs-var">k1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048525"><span class="hs-identifier hs-var">q</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-642"></span><span>                                  </span><span class="hs-comment">-- p can't be Empty, so no need for mkNest</span><span>
</span><span id="line-643"></span><span>
</span><span id="line-644"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#aboveNest"><span class="hs-identifier hs-var">aboveNest</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NilAbove"><span class="hs-identifier hs-type">NilAbove</span></a></span><span> </span><span id="local-6989586621679048524"><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048524"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>        </span><span id="local-6989586621679048523"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048523"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679048522"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048522"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048521"><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048521"><span class="hs-identifier hs-var">q</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RDoc a -&gt; RDoc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilAbove_"><span class="hs-identifier hs-var">nilAbove_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RDoc a -&gt; Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
forall a. RDoc a -&gt; Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#aboveNest"><span class="hs-identifier hs-var">aboveNest</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048524"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048523"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048522"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048521"><span class="hs-identifier hs-var">q</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-645"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#aboveNest"><span class="hs-identifier hs-var">aboveNest</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextBeside"><span class="hs-identifier hs-type">TextBeside</span></a></span><span> </span><span id="local-6989586621679048520"><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048520"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679048519"><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048519"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>    </span><span id="local-6989586621679048518"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048518"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679048517"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048517"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048516"><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048516"><span class="hs-identifier hs-var">q</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotDetails a -&gt; RDoc a -&gt; RDoc a
forall a. AnnotDetails a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextBeside"><span class="hs-identifier hs-var">TextBeside</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048520"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048515"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-646"></span><span>                                    </span><span class="hs-keyword">where</span><span>
</span><span id="line-647"></span><span>                                      </span><span class="hs-glyph">!</span><span id="local-6989586621679048513"><span class="annot"><span class="annottext">k1 :: Int
</span><a href="#local-6989586621679048513"><span class="hs-identifier hs-var hs-var">k1</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048517"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a -&gt; Int
forall a. AnnotDetails a -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#annotSize"><span class="hs-identifier hs-var">annotSize</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048520"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-648"></span><span>                                      </span><span id="local-6989586621679048515"><span class="annot"><span class="annottext">rest :: RDoc a
</span><a href="#local-6989586621679048515"><span class="hs-identifier hs-var hs-var">rest</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048519"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-649"></span><span>                                                </span><span class="annot"><span class="annottext">RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
forall a. Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilAboveNest"><span class="hs-identifier hs-var">nilAboveNest</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048518"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048513"><span class="hs-identifier hs-var">k1</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048516"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-650"></span><span>                                                </span><span class="annot"><span class="annottext">RDoc a
</span><span class="hs-identifier">_</span></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">RDoc a -&gt; Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
forall a. RDoc a -&gt; Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#aboveNest"><span class="hs-identifier hs-var">aboveNest</span></a></span><span>  </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048519"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048518"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048513"><span class="hs-identifier hs-var">k1</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048516"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-651"></span><span>
</span><span id="line-652"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#aboveNest"><span class="hs-identifier hs-var">aboveNest</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Above"><span class="hs-identifier hs-type">Above</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>          </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; RDoc a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;aboveNest Above&quot;</span></span><span>
</span><span id="line-653"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#aboveNest"><span class="hs-identifier hs-var">aboveNest</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Beside"><span class="hs-identifier hs-type">Beside</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>         </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; RDoc a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;aboveNest Beside&quot;</span></span><span>
</span><span id="line-654"></span><span>
</span><span id="line-655"></span><span class="hs-comment">-- Specification: text s &lt;&gt; nilaboveNest g k q</span><span>
</span><span id="line-656"></span><span class="hs-comment">--              = text s &lt;&gt; (text &quot;&quot; $g$ nest k q)</span><span>
</span><span id="line-657"></span><span id="local-6989586621679049137"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilAboveNest"><span class="hs-identifier hs-type">nilAboveNest</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049137"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049137"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-658"></span><span id="nilAboveNest"><span class="annot"><span class="annottext">nilAboveNest :: forall a. Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilAboveNest"><span class="hs-identifier hs-var hs-var">nilAboveNest</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679048505"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048505"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><span class="hs-identifier">_</span></span><span>           </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048505"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RDoc a
forall a. HasCallStack =&gt; a
</span><a href="../../base/src/GHC.Err.html#undefined"><span class="hs-identifier hs-var">undefined</span></a></span><span>
</span><span id="line-659"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilAboveNest"><span class="hs-identifier hs-var">nilAboveNest</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RDoc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-660"></span><span>                               </span><span class="hs-comment">-- Here's why the &quot;text s &lt;&gt;&quot; is in the spec!</span><span>
</span><span id="line-661"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilAboveNest"><span class="hs-identifier hs-var">nilAboveNest</span></a></span><span> </span><span id="local-6989586621679048504"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048504"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679048503"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048503"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Nest"><span class="hs-identifier hs-type">Nest</span></a></span><span> </span><span id="local-6989586621679048502"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048502"><span class="hs-identifier hs-var">k1</span></a></span></span><span> </span><span id="local-6989586621679048501"><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048501"><span class="hs-identifier hs-var">q</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
forall a. Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilAboveNest"><span class="hs-identifier hs-var">nilAboveNest</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048504"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048503"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048502"><span class="hs-identifier hs-var">k1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048501"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-662"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilAboveNest"><span class="hs-identifier hs-var">nilAboveNest</span></a></span><span> </span><span id="local-6989586621679048500"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048500"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679048499"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048499"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048498"><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048498"><span class="hs-identifier hs-var">q</span></a></span></span><span>           </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#not"><span class="hs-identifier hs-var">not</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048500"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048499"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E"><span class="hs-operator hs-var">&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>      </span><span class="hs-comment">-- No newline if no overlap</span><span>
</span><span id="line-663"></span><span>                             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotDetails a -&gt; RDoc a -&gt; RDoc a
forall a. AnnotDetails a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#textBeside_"><span class="hs-identifier hs-var">textBeside_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TextDetails -&gt; Int -&gt; AnnotDetails a
forall a. TextDetails -&gt; Int -&gt; AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoAnnot"><span class="hs-identifier hs-var">NoAnnot</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; TextDetails
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Str"><span class="hs-identifier hs-var">Str</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; String
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#indent"><span class="hs-identifier hs-var">indent</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048499"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048499"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048498"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-664"></span><span>                             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>           </span><span class="hs-comment">-- Put them really above</span><span>
</span><span id="line-665"></span><span>                             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RDoc a -&gt; RDoc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilAbove_"><span class="hs-identifier hs-var">nilAbove_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; RDoc a -&gt; RDoc a
forall a. Int -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mkNest"><span class="hs-identifier hs-var">mkNest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048499"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048498"><span class="hs-identifier hs-var">q</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-666"></span><span>
</span><span id="line-667"></span><span>
</span><span id="line-668"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-669"></span><span class="hs-comment">-- Horizontal composition @&lt;&gt;@</span><span>
</span><span id="line-670"></span><span>
</span><span id="line-671"></span><span class="hs-comment">-- We intentionally avoid Data.Monoid.(&lt;&gt;) here due to interactions of</span><span>
</span><span id="line-672"></span><span class="hs-comment">-- Data.Monoid.(&lt;&gt;) and (&lt;+&gt;).  See</span><span>
</span><span id="line-673"></span><span class="hs-comment">-- http://www.haskell.org/pipermail/libraries/2011-November/017066.html</span><span>
</span><span id="line-674"></span><span>
</span><span id="line-675"></span><span class="hs-comment">-- | Beside.</span><span>
</span><span id="line-676"></span><span class="hs-comment">-- '&lt;&gt;' is associative, with identity 'empty'.</span><span>
</span><span id="line-677"></span><span id="local-6989586621679048494"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%3C%3E"><span class="hs-operator hs-type">(&lt;&gt;)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048494"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048494"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048494"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-678"></span><span id="local-6989586621679048493"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048493"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="%3C%3E"><span class="annot"><span class="annottext">&lt;&gt; :: forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%3C%3E"><span class="hs-operator hs-var hs-var">&lt;&gt;</span></a></span></span><span>  </span><span id="local-6989586621679048492"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048492"><span class="hs-identifier hs-var">q</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside_"><span class="hs-identifier hs-var">beside_</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048493"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048492"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-679"></span><span>
</span><span id="line-680"></span><span class="hs-comment">-- | Beside, separated by space, unless one of the arguments is 'empty'.</span><span>
</span><span id="line-681"></span><span class="hs-comment">-- '&lt;+&gt;' is associative, with identity 'empty'.</span><span>
</span><span id="line-682"></span><span id="local-6989586621679048490"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%3C%2B%3E"><span class="hs-operator hs-type">(&lt;+&gt;)</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048490"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048490"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048490"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-683"></span><span id="local-6989586621679048489"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048489"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="%3C%2B%3E"><span class="annot"><span class="annottext">&lt;+&gt; :: forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#%3C%2B%3E"><span class="hs-operator hs-var hs-var">&lt;+&gt;</span></a></span></span><span> </span><span id="local-6989586621679048488"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048488"><span class="hs-identifier hs-var">q</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside_"><span class="hs-identifier hs-var">beside_</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048489"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span>  </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048488"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-684"></span><span>
</span><span id="line-685"></span><span id="local-6989586621679048487"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside_"><span class="hs-identifier hs-type">beside_</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048487"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048487"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048487"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-686"></span><span id="beside_"><span class="annot"><span class="annottext">beside_ :: forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside_"><span class="hs-identifier hs-var hs-var">beside_</span></a></span></span><span> </span><span id="local-6989586621679048486"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048486"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048486"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-687"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside_"><span class="hs-identifier hs-var">beside_</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679048485"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048485"><span class="hs-identifier hs-var">q</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048485"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-688"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside_"><span class="hs-identifier hs-var">beside_</span></a></span><span> </span><span id="local-6989586621679048484"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048484"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679048483"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048483"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679048482"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048482"><span class="hs-identifier hs-var">q</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Beside"><span class="hs-identifier hs-var">Beside</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048484"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048483"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048482"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-689"></span><span>
</span><span id="line-690"></span><span class="hs-comment">-- Specification: beside g p q = p &lt;g&gt; q</span><span>
</span><span id="line-691"></span><span id="local-6989586621679048481"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside"><span class="hs-identifier hs-type">beside</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048481"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048481"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048481"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-692"></span><span id="beside"><span class="annot"><span class="annottext">beside :: forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside"><span class="hs-identifier hs-var hs-var">beside</span></a></span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>               </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><span class="hs-identifier">_</span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>
</span><span id="line-693"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside"><span class="hs-identifier hs-var">beside</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679048478"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048478"><span class="hs-identifier hs-var">p1</span></a></span></span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Union"><span class="hs-operator hs-type">`Union`</span></a></span><span> </span><span id="local-6989586621679048477"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048477"><span class="hs-identifier hs-var">p2</span></a></span></span><span class="hs-special">)</span><span>     </span><span id="local-6989586621679048476"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048476"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679048475"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048475"><span class="hs-identifier hs-var">q</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside"><span class="hs-identifier hs-var">beside</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048478"><span class="hs-identifier hs-var">p1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048476"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048475"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#union_"><span class="hs-operator hs-var">`union_`</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside"><span class="hs-identifier hs-var">beside</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048477"><span class="hs-identifier hs-var">p2</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048476"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048475"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-694"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside"><span class="hs-identifier hs-var">beside</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>               </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679048474"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048474"><span class="hs-identifier hs-var">q</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048474"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-695"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside"><span class="hs-identifier hs-var">beside</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Nest"><span class="hs-identifier hs-type">Nest</span></a></span><span> </span><span id="local-6989586621679048473"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048473"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048472"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048472"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>          </span><span id="local-6989586621679048471"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048471"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679048470"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048470"><span class="hs-identifier hs-var">q</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Doc a -&gt; Doc a
forall a. Int -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nest_"><span class="hs-identifier hs-var">nest_</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048473"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">(Doc a -&gt; Doc a) -&gt; Doc a -&gt; Doc a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside"><span class="hs-identifier hs-var">beside</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048472"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048471"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048470"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-696"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside"><span class="hs-identifier hs-var">beside</span></a></span><span> </span><span id="local-6989586621679048468"><span class="annot"><span class="annottext">p :: Doc a
</span><a href="#local-6989586621679048468"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Beside"><span class="hs-identifier hs-type">Beside</span></a></span><span> </span><span id="local-6989586621679048467"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048467"><span class="hs-identifier hs-var">p1</span></a></span></span><span> </span><span id="local-6989586621679048466"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048466"><span class="hs-identifier hs-var">g1</span></a></span></span><span> </span><span id="local-6989586621679048465"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048465"><span class="hs-identifier hs-var">q1</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679048464"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048464"><span class="hs-identifier hs-var">g2</span></a></span></span><span> </span><span id="local-6989586621679048463"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048463"><span class="hs-identifier hs-var">q2</span></a></span></span><span>
</span><span id="line-697"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048466"><span class="hs-identifier hs-var">g1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048464"><span class="hs-identifier hs-var">g2</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside"><span class="hs-identifier hs-var">beside</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048467"><span class="hs-identifier hs-var">p1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048466"><span class="hs-identifier hs-var">g1</span></a></span><span> </span><span class="annot"><span class="annottext">(Doc a -&gt; Doc a) -&gt; Doc a -&gt; Doc a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside"><span class="hs-identifier hs-var">beside</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048465"><span class="hs-identifier hs-var">q1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048464"><span class="hs-identifier hs-var">g2</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048463"><span class="hs-identifier hs-var">q2</span></a></span><span>
</span><span id="line-698"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside"><span class="hs-identifier hs-var">beside</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var">reduceDoc</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048468"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048464"><span class="hs-identifier hs-var">g2</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048463"><span class="hs-identifier hs-var">q2</span></a></span><span>
</span><span id="line-699"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside"><span class="hs-identifier hs-var">beside</span></a></span><span> </span><span id="local-6989586621679048462"><span class="annot"><span class="annottext">p :: Doc a
</span><a href="#local-6989586621679048462"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Above"><span class="hs-identifier hs-type">Above</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>         </span><span id="local-6989586621679048461"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048461"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679048460"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048460"><span class="hs-identifier hs-var">q</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679048459"><span class="annot"><span class="annottext">d :: Doc a
</span><a href="#local-6989586621679048459"><span class="hs-identifier hs-var hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var">reduceDoc</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048462"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside"><span class="hs-identifier hs-var">beside</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048459"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048461"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048460"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-700"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside"><span class="hs-identifier hs-var">beside</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NilAbove"><span class="hs-identifier hs-type">NilAbove</span></a></span><span> </span><span id="local-6989586621679048458"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048458"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>        </span><span id="local-6989586621679048457"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048457"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679048456"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048456"><span class="hs-identifier hs-var">q</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilAbove_"><span class="hs-identifier hs-var">nilAbove_</span></a></span><span> </span><span class="annot"><span class="annottext">(Doc a -&gt; Doc a) -&gt; Doc a -&gt; Doc a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside"><span class="hs-identifier hs-var">beside</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048458"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048457"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048456"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-701"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside"><span class="hs-identifier hs-var">beside</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextBeside"><span class="hs-identifier hs-type">TextBeside</span></a></span><span> </span><span id="local-6989586621679048455"><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048455"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621679048454"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048454"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>    </span><span id="local-6989586621679048453"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048453"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679048452"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048452"><span class="hs-identifier hs-var">q</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotDetails a -&gt; Doc a -&gt; Doc a
forall a. AnnotDetails a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextBeside"><span class="hs-identifier hs-var">TextBeside</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048455"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048451"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-702"></span><span>                               </span><span class="hs-keyword">where</span><span>
</span><span id="line-703"></span><span>                                  </span><span id="local-6989586621679048451"><span class="annot"><span class="annottext">rest :: Doc a
</span><a href="#local-6989586621679048451"><span class="hs-identifier hs-var hs-var">rest</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048454"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-704"></span><span>                                           </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Doc a -&gt; Doc a
forall a. Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilBeside"><span class="hs-identifier hs-var">nilBeside</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048453"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048452"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-705"></span><span>                                           </span><span class="annot"><span class="annottext">Doc a
</span><span class="hs-identifier">_</span></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#beside"><span class="hs-identifier hs-var">beside</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048454"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048453"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048452"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-706"></span><span>
</span><span id="line-707"></span><span class="hs-comment">-- Specification: text &quot;&quot; &lt;&gt; nilBeside g p</span><span>
</span><span id="line-708"></span><span class="hs-comment">--              = text &quot;&quot; &lt;g&gt; p</span><span>
</span><span id="line-709"></span><span id="local-6989586621679048449"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilBeside"><span class="hs-identifier hs-type">nilBeside</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048449"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048449"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-710"></span><span id="nilBeside"><span class="annot"><span class="annottext">nilBeside :: forall a. Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilBeside"><span class="hs-identifier hs-var hs-var">nilBeside</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="hs-comment">-- Hence the text &quot;&quot; in the spec</span><span>
</span><span id="line-711"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilBeside"><span class="hs-identifier hs-var">nilBeside</span></a></span><span> </span><span id="local-6989586621679048448"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048448"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Nest"><span class="hs-identifier hs-type">Nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679048447"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048447"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Doc a -&gt; Doc a
forall a. Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilBeside"><span class="hs-identifier hs-var">nilBeside</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048448"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048447"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-712"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilBeside"><span class="hs-identifier hs-var">nilBeside</span></a></span><span> </span><span id="local-6989586621679048446"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048446"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679048445"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048445"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048446"><span class="hs-identifier hs-var">g</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotDetails a -&gt; Doc a -&gt; Doc a
forall a. AnnotDetails a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#textBeside_"><span class="hs-identifier hs-var">textBeside_</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a
forall a. AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#spaceText"><span class="hs-identifier hs-var">spaceText</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048445"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-713"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048445"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-714"></span><span>
</span><span id="line-715"></span><span>
</span><span id="line-716"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-717"></span><span class="hs-comment">-- Separate, @sep@</span><span>
</span><span id="line-718"></span><span>
</span><span id="line-719"></span><span class="hs-comment">-- Specification: sep ps  = oneLiner (hsep ps)</span><span>
</span><span id="line-720"></span><span class="hs-comment">--                         `union`</span><span>
</span><span id="line-721"></span><span class="hs-comment">--                          vcat ps</span><span>
</span><span id="line-722"></span><span>
</span><span id="line-723"></span><span class="hs-comment">-- | Either 'hsep' or 'vcat'.</span><span>
</span><span id="line-724"></span><span id="local-6989586621679048444"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sep"><span class="hs-identifier hs-type">sep</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048444"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048444"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-725"></span><span id="sep"><span class="annot"><span class="annottext">sep :: forall a. [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sep"><span class="hs-identifier hs-var hs-var">sep</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; [Doc a] -&gt; Doc a
forall a. Bool -&gt; [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sepX"><span class="hs-identifier hs-var">sepX</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span>   </span><span class="hs-comment">-- Separate with spaces</span><span>
</span><span id="line-726"></span><span>
</span><span id="line-727"></span><span class="hs-comment">-- | Either 'hcat' or 'vcat'.</span><span>
</span><span id="line-728"></span><span id="local-6989586621679048442"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#cat"><span class="hs-identifier hs-type">cat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048442"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048442"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-729"></span><span id="cat"><span class="annot"><span class="annottext">cat :: forall a. [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#cat"><span class="hs-identifier hs-var hs-var">cat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; [Doc a] -&gt; Doc a
forall a. Bool -&gt; [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sepX"><span class="hs-identifier hs-var">sepX</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span>  </span><span class="hs-comment">-- Don't</span><span>
</span><span id="line-730"></span><span>
</span><span id="line-731"></span><span id="local-6989586621679049126"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sepX"><span class="hs-identifier hs-type">sepX</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049126"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049126"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-732"></span><span id="sepX"><span class="annot"><span class="annottext">sepX :: forall a. Bool -&gt; [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sepX"><span class="hs-identifier hs-var hs-var">sepX</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-733"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sepX"><span class="hs-identifier hs-var">sepX</span></a></span><span> </span><span id="local-6989586621679048441"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048441"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679048440"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048440"><span class="hs-identifier hs-var">p</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679048439"><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048439"><span class="hs-identifier hs-var">ps</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Doc a -&gt; Int -&gt; [Doc a] -&gt; Doc a
forall a. Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sep1"><span class="hs-identifier hs-var">sep1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048441"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var">reduceDoc</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048440"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048439"><span class="hs-identifier hs-var">ps</span></a></span><span>
</span><span id="line-734"></span><span>
</span><span id="line-735"></span><span>
</span><span id="line-736"></span><span class="hs-comment">-- Specification: sep1 g k ys = sep (x : map (nest k) ys)</span><span>
</span><span id="line-737"></span><span class="hs-comment">--                            = oneLiner (x &lt;g&gt; nest k (hsep ys))</span><span>
</span><span id="line-738"></span><span class="hs-comment">--                              `union` x $$ nest k (vcat ys)</span><span>
</span><span id="line-739"></span><span id="local-6989586621679049123"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sep1"><span class="hs-identifier hs-type">sep1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049123"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049123"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049123"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-740"></span><span id="sep1"><span class="annot"><span class="annottext">sep1 :: forall a. Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sep1"><span class="hs-identifier hs-var hs-var">sep1</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><span class="hs-identifier">_</span></span><span>                   </span><span id="local-6989586621679048429"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048429"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="annot"><span class="annottext">[RDoc a]
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048429"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RDoc a
forall a. HasCallStack =&gt; a
</span><a href="../../base/src/GHC.Err.html#undefined"><span class="hs-identifier hs-var">undefined</span></a></span><span>
</span><span id="line-741"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sep1"><span class="hs-identifier hs-var">sep1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>               </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[RDoc a]
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RDoc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>
</span><span id="line-742"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sep1"><span class="hs-identifier hs-var">sep1</span></a></span><span> </span><span id="local-6989586621679048428"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048428"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679048427"><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048427"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Union"><span class="hs-operator hs-type">`Union`</span></a></span><span> </span><span id="local-6989586621679048426"><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048426"><span class="hs-identifier hs-var">q</span></a></span></span><span class="hs-special">)</span><span>       </span><span id="local-6989586621679048425"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048425"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048424"><span class="annot"><span class="annottext">[RDoc a]
</span><a href="#local-6989586621679048424"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
forall a. Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sep1"><span class="hs-identifier hs-var">sep1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048428"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048427"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048425"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">[RDoc a]
</span><a href="#local-6989586621679048424"><span class="hs-identifier hs-var">ys</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a -&gt; RDoc a -&gt; RDoc a
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#union_"><span class="hs-operator hs-var">`union_`</span></a></span><span>
</span><span id="line-743"></span><span>                                  </span><span class="annot"><span class="annottext">RDoc a -&gt; Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
forall a. RDoc a -&gt; Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#aboveNest"><span class="hs-identifier hs-var">aboveNest</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048426"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048425"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RDoc a -&gt; RDoc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var">reduceDoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[RDoc a] -&gt; RDoc a
forall a. [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="annot"><span class="annottext">[RDoc a]
</span><a href="#local-6989586621679048424"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-744"></span><span>
</span><span id="line-745"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sep1"><span class="hs-identifier hs-var">sep1</span></a></span><span> </span><span id="local-6989586621679048423"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048423"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>               </span><span id="local-6989586621679048422"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048422"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048421"><span class="annot"><span class="annottext">[RDoc a]
</span><a href="#local-6989586621679048421"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; RDoc a -&gt; RDoc a
forall a. Int -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mkNest"><span class="hs-identifier hs-var">mkNest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048422"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; [RDoc a] -&gt; RDoc a
forall a. Bool -&gt; [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sepX"><span class="hs-identifier hs-var">sepX</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048423"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">[RDoc a]
</span><a href="#local-6989586621679048421"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-746"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sep1"><span class="hs-identifier hs-var">sep1</span></a></span><span> </span><span id="local-6989586621679048420"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048420"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Nest"><span class="hs-identifier hs-type">Nest</span></a></span><span> </span><span id="local-6989586621679048419"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048419"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679048418"><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048418"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>          </span><span id="local-6989586621679048417"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048417"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048416"><span class="annot"><span class="annottext">[RDoc a]
</span><a href="#local-6989586621679048416"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; RDoc a -&gt; RDoc a
forall a. Int -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nest_"><span class="hs-identifier hs-var">nest_</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048419"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
forall a. Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sep1"><span class="hs-identifier hs-var">sep1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048420"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048418"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048417"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048419"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[RDoc a]
</span><a href="#local-6989586621679048416"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-747"></span><span>
</span><span id="line-748"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sep1"><span class="hs-identifier hs-var">sep1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NilAbove"><span class="hs-identifier hs-type">NilAbove</span></a></span><span> </span><span id="local-6989586621679048415"><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048415"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>        </span><span id="local-6989586621679048414"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048414"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048413"><span class="annot"><span class="annottext">[RDoc a]
</span><a href="#local-6989586621679048413"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RDoc a -&gt; RDoc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilAbove_"><span class="hs-identifier hs-var">nilAbove_</span></a></span><span>
</span><span id="line-749"></span><span>                                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RDoc a -&gt; Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
forall a. RDoc a -&gt; Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#aboveNest"><span class="hs-identifier hs-var">aboveNest</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048415"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048414"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RDoc a -&gt; RDoc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var">reduceDoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[RDoc a] -&gt; RDoc a
forall a. [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="annot"><span class="annottext">[RDoc a]
</span><a href="#local-6989586621679048413"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-750"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sep1"><span class="hs-identifier hs-var">sep1</span></a></span><span> </span><span id="local-6989586621679048412"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048412"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextBeside"><span class="hs-identifier hs-type">TextBeside</span></a></span><span> </span><span id="local-6989586621679048411"><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048411"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679048410"><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048410"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679048409"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048409"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048408"><span class="annot"><span class="annottext">[RDoc a]
</span><a href="#local-6989586621679048408"><span class="hs-identifier hs-var">ys</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotDetails a -&gt; RDoc a -&gt; RDoc a
forall a. AnnotDetails a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#textBeside_"><span class="hs-identifier hs-var">textBeside_</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048411"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
forall a. Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sepNB"><span class="hs-identifier hs-var">sepNB</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048412"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048410"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048409"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a -&gt; Int
forall a. AnnotDetails a -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#annotSize"><span class="hs-identifier hs-var">annotSize</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048411"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[RDoc a]
</span><a href="#local-6989586621679048408"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-751"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sep1"><span class="hs-identifier hs-var">sep1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Above"><span class="hs-identifier hs-type">Above</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>          </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[RDoc a]
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; RDoc a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;sep1 Above&quot;</span></span><span>
</span><span id="line-752"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sep1"><span class="hs-identifier hs-var">sep1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Beside"><span class="hs-identifier hs-type">Beside</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>         </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[RDoc a]
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; RDoc a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;sep1 Beside&quot;</span></span><span>
</span><span id="line-753"></span><span>
</span><span id="line-754"></span><span class="hs-comment">-- Specification: sepNB p k ys = sep1 (text &quot;&quot; &lt;&gt; p) k ys</span><span>
</span><span id="line-755"></span><span class="hs-comment">-- Called when we have already found some text in the first item</span><span>
</span><span id="line-756"></span><span class="hs-comment">-- We have to eat up nests</span><span>
</span><span id="line-757"></span><span id="local-6989586621679048406"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sepNB"><span class="hs-identifier hs-type">sepNB</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048406"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048406"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048406"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-758"></span><span id="sepNB"><span class="annot"><span class="annottext">sepNB :: forall a. Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sepNB"><span class="hs-identifier hs-var hs-var">sepNB</span></a></span></span><span> </span><span id="local-6989586621679048405"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048405"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Nest"><span class="hs-identifier hs-type">Nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679048404"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048404"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679048403"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048403"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048402"><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048402"><span class="hs-identifier hs-var">ys</span></a></span></span><span>
</span><span id="line-759"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Doc a -&gt; Int -&gt; [Doc a] -&gt; Doc a
forall a. Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sepNB"><span class="hs-identifier hs-var">sepNB</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048405"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048404"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048403"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048402"><span class="hs-identifier hs-var">ys</span></a></span><span> </span><span class="hs-comment">-- Never triggered, because of invariant (2)</span><span>
</span><span id="line-760"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sepNB"><span class="hs-identifier hs-var">sepNB</span></a></span><span> </span><span id="local-6989586621679048401"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048401"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span id="local-6989586621679048400"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048400"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048399"><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048399"><span class="hs-identifier hs-var">ys</span></a></span></span><span>
</span><span id="line-761"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#oneLiner"><span class="hs-identifier hs-var">oneLiner</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Doc a -&gt; Doc a
forall a. Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilBeside"><span class="hs-identifier hs-var">nilBeside</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048401"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var">reduceDoc</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048397"><span class="hs-identifier hs-var">rest</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mkUnion"><span class="hs-operator hs-var">`mkUnion`</span></a></span><span>
</span><span id="line-762"></span><span>    </span><span class="hs-comment">-- XXX: TODO: PRETTY: Used to use True here (but GHC used False...)</span><span>
</span><span id="line-763"></span><span>    </span><span class="annot"><span class="annottext">Bool -&gt; Int -&gt; Doc a -&gt; Doc a
forall a. Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilAboveNest"><span class="hs-identifier hs-var">nilAboveNest</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048400"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var">reduceDoc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Doc a] -&gt; Doc a
forall a. [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048399"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-764"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-765"></span><span>    </span><span id="local-6989586621679048397"><span class="annot"><span class="annottext">rest :: Doc a
</span><a href="#local-6989586621679048397"><span class="hs-identifier hs-var hs-var">rest</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048401"><span class="hs-identifier hs-var">g</span></a></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Doc a] -&gt; Doc a
forall a. [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#hsep"><span class="hs-identifier hs-var">hsep</span></a></span><span> </span><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048399"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-766"></span><span>         </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Doc a] -&gt; Doc a
forall a. [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#hcat"><span class="hs-identifier hs-var">hcat</span></a></span><span> </span><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048399"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-767"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sepNB"><span class="hs-identifier hs-var">sepNB</span></a></span><span> </span><span id="local-6989586621679048396"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048396"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679048395"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048395"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679048394"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048394"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048393"><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048393"><span class="hs-identifier hs-var">ys</span></a></span></span><span>
</span><span id="line-768"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Doc a -&gt; Int -&gt; [Doc a] -&gt; Doc a
forall a. Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sep1"><span class="hs-identifier hs-var">sep1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048396"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048395"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048394"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048393"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-769"></span><span>
</span><span id="line-770"></span><span>
</span><span id="line-771"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-772"></span><span class="hs-comment">-- @fill@</span><span>
</span><span id="line-773"></span><span>
</span><span id="line-774"></span><span class="hs-comment">-- | \&quot;Paragraph fill\&quot; version of 'cat'.</span><span>
</span><span id="line-775"></span><span id="local-6989586621679048392"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fcat"><span class="hs-identifier hs-type">fcat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048392"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048392"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-776"></span><span id="fcat"><span class="annot"><span class="annottext">fcat :: forall a. [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fcat"><span class="hs-identifier hs-var hs-var">fcat</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; [Doc a] -&gt; Doc a
forall a. Bool -&gt; [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill"><span class="hs-identifier hs-var">fill</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span>
</span><span id="line-777"></span><span>
</span><span id="line-778"></span><span class="hs-comment">-- | \&quot;Paragraph fill\&quot; version of 'sep'.</span><span>
</span><span id="line-779"></span><span id="local-6989586621679048390"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fsep"><span class="hs-identifier hs-type">fsep</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048390"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048390"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-780"></span><span id="fsep"><span class="annot"><span class="annottext">fsep :: forall a. [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fsep"><span class="hs-identifier hs-var hs-var">fsep</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; [Doc a] -&gt; Doc a
forall a. Bool -&gt; [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill"><span class="hs-identifier hs-var">fill</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span>
</span><span id="line-781"></span><span>
</span><span id="line-782"></span><span class="hs-comment">-- Specification:</span><span>
</span><span id="line-783"></span><span class="hs-comment">--</span><span>
</span><span id="line-784"></span><span class="hs-comment">-- fill g docs = fillIndent 0 docs</span><span>
</span><span id="line-785"></span><span class="hs-comment">--</span><span>
</span><span id="line-786"></span><span class="hs-comment">-- fillIndent k [] = []</span><span>
</span><span id="line-787"></span><span class="hs-comment">-- fillIndent k [p] = p</span><span>
</span><span id="line-788"></span><span class="hs-comment">-- fillIndent k (p1:p2:ps) =</span><span>
</span><span id="line-789"></span><span class="hs-comment">--    oneLiner p1 &lt;g&gt; fillIndent (k + length p1 + g ? 1 : 0)</span><span>
</span><span id="line-790"></span><span class="hs-comment">--                               (remove_nests (oneLiner p2) : ps)</span><span>
</span><span id="line-791"></span><span class="hs-comment">--     `Union`</span><span>
</span><span id="line-792"></span><span class="hs-comment">--    (p1 $*$ nest (-k) (fillIndent 0 ps))</span><span>
</span><span id="line-793"></span><span class="hs-comment">--</span><span>
</span><span id="line-794"></span><span class="hs-comment">-- $*$ is defined for layouts (not Docs) as</span><span>
</span><span id="line-795"></span><span class="hs-comment">-- layout1 $*$ layout2 | hasMoreThanOneLine layout1 = layout1 $$ layout2</span><span>
</span><span id="line-796"></span><span class="hs-comment">--                     | otherwise                  = layout1 $+$ layout2</span><span>
</span><span id="line-797"></span><span>
</span><span id="line-798"></span><span id="local-6989586621679048389"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill"><span class="hs-identifier hs-type">fill</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048389"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048389"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-799"></span><span id="fill"><span class="annot"><span class="annottext">fill :: forall a. Bool -&gt; [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill"><span class="hs-identifier hs-var hs-var">fill</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-800"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill"><span class="hs-identifier hs-var">fill</span></a></span><span> </span><span id="local-6989586621679048388"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048388"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679048387"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048387"><span class="hs-identifier hs-var">p</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679048386"><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048386"><span class="hs-identifier hs-var">ps</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Doc a -&gt; Int -&gt; [Doc a] -&gt; Doc a
forall a. Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill1"><span class="hs-identifier hs-var">fill1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048388"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var">reduceDoc</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048387"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048386"><span class="hs-identifier hs-var">ps</span></a></span><span>
</span><span id="line-801"></span><span>
</span><span id="line-802"></span><span id="local-6989586621679048384"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill1"><span class="hs-identifier hs-type">fill1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048384"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048384"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048384"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-803"></span><span id="fill1"><span class="annot"><span class="annottext">fill1 :: forall a. Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill1"><span class="hs-identifier hs-var hs-var">fill1</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><span class="hs-identifier">_</span></span><span>                   </span><span id="local-6989586621679048375"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048375"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="annot"><span class="annottext">[RDoc a]
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048375"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RDoc a
forall a. HasCallStack =&gt; a
</span><a href="../../base/src/GHC.Err.html#undefined"><span class="hs-identifier hs-var">undefined</span></a></span><span>
</span><span id="line-804"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill1"><span class="hs-identifier hs-var">fill1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>               </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[RDoc a]
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RDoc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>
</span><span id="line-805"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill1"><span class="hs-identifier hs-var">fill1</span></a></span><span> </span><span id="local-6989586621679048374"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048374"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679048373"><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048373"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Union"><span class="hs-operator hs-type">`Union`</span></a></span><span> </span><span id="local-6989586621679048372"><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048372"><span class="hs-identifier hs-var">q</span></a></span></span><span class="hs-special">)</span><span>       </span><span id="local-6989586621679048371"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048371"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048370"><span class="annot"><span class="annottext">[RDoc a]
</span><a href="#local-6989586621679048370"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
forall a. Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill1"><span class="hs-identifier hs-var">fill1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048374"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048373"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048371"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">[RDoc a]
</span><a href="#local-6989586621679048370"><span class="hs-identifier hs-var">ys</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a -&gt; RDoc a -&gt; RDoc a
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#union_"><span class="hs-operator hs-var">`union_`</span></a></span><span>
</span><span id="line-806"></span><span>                                   </span><span class="annot"><span class="annottext">RDoc a -&gt; Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
forall a. RDoc a -&gt; Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#aboveNest"><span class="hs-identifier hs-var">aboveNest</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048372"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048371"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; [RDoc a] -&gt; RDoc a
forall a. Bool -&gt; [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill"><span class="hs-identifier hs-var">fill</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048374"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">[RDoc a]
</span><a href="#local-6989586621679048370"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-807"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill1"><span class="hs-identifier hs-var">fill1</span></a></span><span> </span><span id="local-6989586621679048369"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048369"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>               </span><span id="local-6989586621679048368"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048368"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048367"><span class="annot"><span class="annottext">[RDoc a]
</span><a href="#local-6989586621679048367"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; RDoc a -&gt; RDoc a
forall a. Int -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mkNest"><span class="hs-identifier hs-var">mkNest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048368"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; [RDoc a] -&gt; RDoc a
forall a. Bool -&gt; [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill"><span class="hs-identifier hs-var">fill</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048369"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">[RDoc a]
</span><a href="#local-6989586621679048367"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-808"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill1"><span class="hs-identifier hs-var">fill1</span></a></span><span> </span><span id="local-6989586621679048366"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048366"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Nest"><span class="hs-identifier hs-type">Nest</span></a></span><span> </span><span id="local-6989586621679048365"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048365"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679048364"><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048364"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>          </span><span id="local-6989586621679048363"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048363"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048362"><span class="annot"><span class="annottext">[RDoc a]
</span><a href="#local-6989586621679048362"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; RDoc a -&gt; RDoc a
forall a. Int -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nest_"><span class="hs-identifier hs-var">nest_</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048365"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
forall a. Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill1"><span class="hs-identifier hs-var">fill1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048366"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048364"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048363"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048365"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[RDoc a]
</span><a href="#local-6989586621679048362"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-809"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill1"><span class="hs-identifier hs-var">fill1</span></a></span><span> </span><span id="local-6989586621679048361"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048361"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NilAbove"><span class="hs-identifier hs-type">NilAbove</span></a></span><span> </span><span id="local-6989586621679048360"><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048360"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>        </span><span id="local-6989586621679048359"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048359"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048358"><span class="annot"><span class="annottext">[RDoc a]
</span><a href="#local-6989586621679048358"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RDoc a -&gt; RDoc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilAbove_"><span class="hs-identifier hs-var">nilAbove_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RDoc a -&gt; Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
forall a. RDoc a -&gt; Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#aboveNest"><span class="hs-identifier hs-var">aboveNest</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048360"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048359"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; [RDoc a] -&gt; RDoc a
forall a. Bool -&gt; [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill"><span class="hs-identifier hs-var">fill</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048361"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">[RDoc a]
</span><a href="#local-6989586621679048358"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-810"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill1"><span class="hs-identifier hs-var">fill1</span></a></span><span> </span><span id="local-6989586621679048357"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048357"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextBeside"><span class="hs-identifier hs-type">TextBeside</span></a></span><span> </span><span id="local-6989586621679048356"><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048356"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679048355"><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048355"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>    </span><span id="local-6989586621679048354"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048354"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048353"><span class="annot"><span class="annottext">[RDoc a]
</span><a href="#local-6989586621679048353"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotDetails a -&gt; RDoc a -&gt; RDoc a
forall a. AnnotDetails a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#textBeside_"><span class="hs-identifier hs-var">textBeside_</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048356"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
forall a. Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fillNB"><span class="hs-identifier hs-var">fillNB</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048357"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">RDoc a
</span><a href="#local-6989586621679048355"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048354"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a -&gt; Int
forall a. AnnotDetails a -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#annotSize"><span class="hs-identifier hs-var">annotSize</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048356"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[RDoc a]
</span><a href="#local-6989586621679048353"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-811"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill1"><span class="hs-identifier hs-var">fill1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Above"><span class="hs-identifier hs-type">Above</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>          </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[RDoc a]
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; RDoc a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;fill1 Above&quot;</span></span><span>
</span><span id="line-812"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill1"><span class="hs-identifier hs-var">fill1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Beside"><span class="hs-identifier hs-type">Beside</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>         </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[RDoc a]
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; RDoc a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;fill1 Beside&quot;</span></span><span>
</span><span id="line-813"></span><span>
</span><span id="line-814"></span><span id="local-6989586621679048351"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fillNB"><span class="hs-identifier hs-type">fillNB</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048351"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048351"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048351"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-815"></span><span id="fillNB"><span class="annot"><span class="annottext">fillNB :: forall a. Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fillNB"><span class="hs-identifier hs-var hs-var">fillNB</span></a></span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><span class="hs-identifier">_</span></span><span>           </span><span id="local-6989586621679048348"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048348"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="annot"><span class="annottext">[Doc a]
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048348"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. HasCallStack =&gt; a
</span><a href="../../base/src/GHC.Err.html#undefined"><span class="hs-identifier hs-var">undefined</span></a></span><span>
</span><span id="line-816"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fillNB"><span class="hs-identifier hs-var">fillNB</span></a></span><span> </span><span id="local-6989586621679048347"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048347"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Nest"><span class="hs-identifier hs-type">Nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679048346"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048346"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>  </span><span id="local-6989586621679048345"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048345"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048344"><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048344"><span class="hs-identifier hs-var">ys</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Doc a -&gt; Int -&gt; [Doc a] -&gt; Doc a
forall a. Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fillNB"><span class="hs-identifier hs-var">fillNB</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048347"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048346"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048345"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048344"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-817"></span><span>                              </span><span class="hs-comment">-- Never triggered, because of invariant (2)</span><span>
</span><span id="line-818"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fillNB"><span class="hs-identifier hs-var">fillNB</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-819"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fillNB"><span class="hs-identifier hs-var">fillNB</span></a></span><span> </span><span id="local-6989586621679048343"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048343"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span id="local-6989586621679048342"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048342"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679048341"><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048341"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Doc a -&gt; Int -&gt; [Doc a] -&gt; Doc a
forall a. Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fillNB"><span class="hs-identifier hs-var">fillNB</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048343"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048342"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048341"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-820"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fillNB"><span class="hs-identifier hs-var">fillNB</span></a></span><span> </span><span id="local-6989586621679048340"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048340"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span> </span><span id="local-6989586621679048339"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048339"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679048338"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048338"><span class="hs-identifier hs-var">y</span></a></span></span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span id="local-6989586621679048337"><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048337"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Int -&gt; Doc a -&gt; [Doc a] -&gt; Doc a
forall a. Bool -&gt; Int -&gt; Doc a -&gt; [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fillNBE"><span class="hs-identifier hs-var">fillNBE</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048340"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048339"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048338"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048337"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-821"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fillNB"><span class="hs-identifier hs-var">fillNB</span></a></span><span> </span><span id="local-6989586621679048335"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048335"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679048334"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048334"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679048333"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048333"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048332"><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048332"><span class="hs-identifier hs-var">ys</span></a></span></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Doc a -&gt; Int -&gt; [Doc a] -&gt; Doc a
forall a. Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill1"><span class="hs-identifier hs-var">fill1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048335"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048334"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048333"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048332"><span class="hs-identifier hs-var">ys</span></a></span><span>
</span><span id="line-822"></span><span>
</span><span id="line-823"></span><span>
</span><span id="line-824"></span><span id="local-6989586621679049115"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fillNBE"><span class="hs-identifier hs-type">fillNBE</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049115"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049115"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049115"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-825"></span><span id="fillNBE"><span class="annot"><span class="annottext">fillNBE :: forall a. Bool -&gt; Int -&gt; Doc a -&gt; [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fillNBE"><span class="hs-identifier hs-var hs-var">fillNBE</span></a></span></span><span> </span><span id="local-6989586621679048331"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048331"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span id="local-6989586621679048330"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048330"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048329"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048329"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span id="local-6989586621679048328"><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048328"><span class="hs-identifier hs-var">ys</span></a></span></span><span>
</span><span id="line-826"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Doc a -&gt; Doc a
forall a. Bool -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilBeside"><span class="hs-identifier hs-var">nilBeside</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048331"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Doc a -&gt; Int -&gt; [Doc a] -&gt; Doc a
forall a. Bool -&gt; RDoc a -&gt; Int -&gt; [RDoc a] -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill1"><span class="hs-identifier hs-var">fill1</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048331"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#elideNest"><span class="hs-identifier hs-var">elideNest</span></a></span><span> </span><span class="annot"><span class="annottext">(Doc a -&gt; Doc a) -&gt; (Doc a -&gt; Doc a) -&gt; Doc a -&gt; Doc a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#oneLiner"><span class="hs-identifier hs-var">oneLiner</span></a></span><span> </span><span class="annot"><span class="annottext">(Doc a -&gt; Doc a) -&gt; (Doc a -&gt; Doc a) -&gt; Doc a -&gt; Doc a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var">reduceDoc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048329"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048326"><span class="hs-identifier hs-var">k'</span></a></span><span> </span><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048328"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-827"></span><span>    </span><span class="hs-comment">-- XXX: TODO: PRETTY: Used to use True here (but GHC used False...)</span><span>
</span><span id="line-828"></span><span>    </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mkUnion"><span class="hs-operator hs-var">`mkUnion`</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Int -&gt; Doc a -&gt; Doc a
forall a. Bool -&gt; Int -&gt; RDoc a -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilAboveNest"><span class="hs-identifier hs-var">nilAboveNest</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048330"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; [Doc a] -&gt; Doc a
forall a. Bool -&gt; [Doc a] -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fill"><span class="hs-identifier hs-var">fill</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048331"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048329"><span class="hs-identifier hs-var">y</span></a></span><span class="annot"><span class="annottext">Doc a -&gt; [Doc a] -&gt; [Doc a]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">[Doc a]
</span><a href="#local-6989586621679048328"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-829"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679048326"><span class="annot"><span class="annottext">k' :: Int
</span><a href="#local-6989586621679048326"><span class="hs-identifier hs-var hs-var">k'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679048331"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048330"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048330"><span class="hs-identifier hs-var">k</span></a></span><span>
</span><span id="line-830"></span><span>
</span><span id="line-831"></span><span id="local-6989586621679048323"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#elideNest"><span class="hs-identifier hs-type">elideNest</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048323"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048323"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-832"></span><span id="elideNest"><span class="annot"><span class="annottext">elideNest :: forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#elideNest"><span class="hs-identifier hs-var hs-var">elideNest</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Nest"><span class="hs-identifier hs-type">Nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679048322"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048322"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048322"><span class="hs-identifier hs-var">d</span></a></span><span>
</span><span id="line-833"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#elideNest"><span class="hs-identifier hs-var">elideNest</span></a></span><span> </span><span id="local-6989586621679048321"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048321"><span class="hs-identifier hs-var">d</span></a></span></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048321"><span class="hs-identifier hs-var">d</span></a></span><span>
</span><span id="line-834"></span><span>
</span><span id="line-835"></span><span>
</span><span id="line-836"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-837"></span><span class="hs-comment">-- Selecting the best layout</span><span>
</span><span id="line-838"></span><span>
</span><span id="line-839"></span><span id="local-6989586621679049112"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#best"><span class="hs-identifier hs-type">best</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>   </span><span class="hs-comment">-- Line length.</span><span>
</span><span id="line-840"></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>   </span><span class="hs-comment">-- Ribbon length.</span><span>
</span><span id="line-841"></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049112"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-842"></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#RDoc"><span class="hs-identifier hs-type">RDoc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049112"><span class="hs-identifier hs-type">a</span></a></span></span><span>  </span><span class="hs-comment">-- No unions in here!.</span><span>
</span><span id="line-843"></span><span id="best"><span class="annot"><span class="annottext">best :: forall a. Int -&gt; Int -&gt; RDoc a -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#best"><span class="hs-identifier hs-var hs-var">best</span></a></span></span><span> </span><span id="local-6989586621679048319"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048319"><span class="hs-identifier hs-var">w0</span></a></span></span><span> </span><span id="local-6989586621679048318"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048318"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Doc a -&gt; Doc a
forall a. Int -&gt; Doc a -&gt; Doc a
</span><a href="#local-6989586621679048317"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048319"><span class="hs-identifier hs-var">w0</span></a></span><span>
</span><span id="line-844"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-845"></span><span>    </span><span id="local-6989586621679048317"><span class="annot"><span class="annottext">get :: Int -&gt; Doc a -&gt; Doc a
</span><a href="#local-6989586621679048317"><span class="hs-identifier hs-var hs-var">get</span></a></span></span><span> </span><span id="local-6989586621679048297"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048297"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048297"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. HasCallStack =&gt; a
</span><a href="../../base/src/GHC.Err.html#undefined"><span class="hs-identifier hs-var">undefined</span></a></span><span>
</span><span id="line-846"></span><span>    </span><span class="annot"><a href="#local-6989586621679048317"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-847"></span><span>    </span><span class="annot"><a href="#local-6989586621679048317"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>
</span><span id="line-848"></span><span>    </span><span class="annot"><a href="#local-6989586621679048317"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span id="local-6989586621679048296"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048296"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NilAbove"><span class="hs-identifier hs-type">NilAbove</span></a></span><span> </span><span id="local-6989586621679048295"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048295"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilAbove_"><span class="hs-identifier hs-var">nilAbove_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Doc a -&gt; Doc a
</span><a href="#local-6989586621679048317"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048296"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048295"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-849"></span><span>    </span><span class="annot"><a href="#local-6989586621679048317"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span id="local-6989586621679048294"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048294"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextBeside"><span class="hs-identifier hs-type">TextBeside</span></a></span><span> </span><span id="local-6989586621679048293"><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048293"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679048292"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048292"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotDetails a -&gt; Doc a -&gt; Doc a
forall a. AnnotDetails a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#textBeside_"><span class="hs-identifier hs-var">textBeside_</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048293"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Doc a -&gt; Doc a
</span><a href="#local-6989586621679048291"><span class="hs-identifier hs-var">get1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048294"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">AnnotDetails a -&gt; Int
forall a. AnnotDetails a -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#annotSize"><span class="hs-identifier hs-var">annotSize</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048293"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048292"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-850"></span><span>    </span><span class="annot"><a href="#local-6989586621679048317"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span id="local-6989586621679048290"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048290"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Nest"><span class="hs-identifier hs-type">Nest</span></a></span><span> </span><span id="local-6989586621679048289"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048289"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048288"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048288"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Doc a -&gt; Doc a
forall a. Int -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nest_"><span class="hs-identifier hs-var">nest_</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048289"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Doc a -&gt; Doc a
</span><a href="#local-6989586621679048317"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048290"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048289"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048288"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-851"></span><span>    </span><span class="annot"><a href="#local-6989586621679048317"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span id="local-6989586621679048287"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048287"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679048286"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048286"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Union"><span class="hs-operator hs-type">`Union`</span></a></span><span> </span><span id="local-6989586621679048285"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048285"><span class="hs-identifier hs-var">q</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Doc a -&gt; Doc a -&gt; Doc a
forall a. Int -&gt; Int -&gt; Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nicest"><span class="hs-identifier hs-var">nicest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048287"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048318"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Doc a -&gt; Doc a
</span><a href="#local-6989586621679048317"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048287"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048286"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Doc a -&gt; Doc a
</span><a href="#local-6989586621679048317"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048287"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048285"><span class="hs-identifier hs-var">q</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-852"></span><span>    </span><span class="annot"><a href="#local-6989586621679048317"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Above"><span class="hs-identifier hs-type">Above</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Doc a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;best get Above&quot;</span></span><span>
</span><span id="line-853"></span><span>    </span><span class="annot"><a href="#local-6989586621679048317"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Beside"><span class="hs-identifier hs-type">Beside</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Doc a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;best get Beside&quot;</span></span><span>
</span><span id="line-854"></span><span>
</span><span id="line-855"></span><span>    </span><span id="local-6989586621679048291"><span class="annot"><span class="annottext">get1 :: Int -&gt; Int -&gt; Doc a -&gt; Doc a
</span><a href="#local-6989586621679048291"><span class="hs-identifier hs-var hs-var">get1</span></a></span></span><span> </span><span id="local-6989586621679048283"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048283"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048283"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%26%26"><span class="hs-operator hs-var">&amp;&amp;</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. HasCallStack =&gt; a
</span><a href="../../base/src/GHC.Err.html#undefined"><span class="hs-identifier hs-var">undefined</span></a></span><span>
</span><span id="line-856"></span><span>    </span><span class="annot"><a href="#local-6989586621679048291"><span class="hs-identifier hs-var">get1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span>  </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-857"></span><span>    </span><span class="annot"><a href="#local-6989586621679048291"><span class="hs-identifier hs-var">get1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span>  </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>
</span><span id="line-858"></span><span>    </span><span class="annot"><a href="#local-6989586621679048291"><span class="hs-identifier hs-var">get1</span></a></span><span> </span><span id="local-6989586621679048282"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048282"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span id="local-6989586621679048281"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048281"><span class="hs-identifier hs-var">sl</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NilAbove"><span class="hs-identifier hs-type">NilAbove</span></a></span><span> </span><span id="local-6989586621679048280"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048280"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nilAbove_"><span class="hs-identifier hs-var">nilAbove_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Doc a -&gt; Doc a
</span><a href="#local-6989586621679048317"><span class="hs-identifier hs-var">get</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048282"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048281"><span class="hs-identifier hs-var">sl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048280"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-859"></span><span>    </span><span class="annot"><a href="#local-6989586621679048291"><span class="hs-identifier hs-var">get1</span></a></span><span> </span><span id="local-6989586621679048279"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048279"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span id="local-6989586621679048278"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048278"><span class="hs-identifier hs-var">sl</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextBeside"><span class="hs-identifier hs-type">TextBeside</span></a></span><span> </span><span id="local-6989586621679048277"><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048277"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679048276"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048276"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotDetails a -&gt; Doc a -&gt; Doc a
forall a. AnnotDetails a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#textBeside_"><span class="hs-identifier hs-var">textBeside_</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048277"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Doc a -&gt; Doc a
</span><a href="#local-6989586621679048291"><span class="hs-identifier hs-var">get1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048279"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048278"><span class="hs-identifier hs-var">sl</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a -&gt; Int
forall a. AnnotDetails a -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#annotSize"><span class="hs-identifier hs-var">annotSize</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048277"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048276"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-860"></span><span>    </span><span class="annot"><a href="#local-6989586621679048291"><span class="hs-identifier hs-var">get1</span></a></span><span> </span><span id="local-6989586621679048275"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048275"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span id="local-6989586621679048274"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048274"><span class="hs-identifier hs-var">sl</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Nest"><span class="hs-identifier hs-type">Nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679048273"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048273"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Doc a -&gt; Doc a
</span><a href="#local-6989586621679048291"><span class="hs-identifier hs-var">get1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048275"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048274"><span class="hs-identifier hs-var">sl</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048273"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-861"></span><span>    </span><span class="annot"><a href="#local-6989586621679048291"><span class="hs-identifier hs-var">get1</span></a></span><span> </span><span id="local-6989586621679048272"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048272"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span id="local-6989586621679048271"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048271"><span class="hs-identifier hs-var">sl</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679048270"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048270"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Union"><span class="hs-operator hs-type">`Union`</span></a></span><span> </span><span id="local-6989586621679048269"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048269"><span class="hs-identifier hs-var">q</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int -&gt; Doc a -&gt; Doc a -&gt; Doc a
forall a. Int -&gt; Int -&gt; Int -&gt; Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nicest1"><span class="hs-identifier hs-var">nicest1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048272"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048318"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048271"><span class="hs-identifier hs-var">sl</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Doc a -&gt; Doc a
</span><a href="#local-6989586621679048291"><span class="hs-identifier hs-var">get1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048272"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048271"><span class="hs-identifier hs-var">sl</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048270"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-862"></span><span>                                                   </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Doc a -&gt; Doc a
</span><a href="#local-6989586621679048291"><span class="hs-identifier hs-var">get1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048272"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048271"><span class="hs-identifier hs-var">sl</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048269"><span class="hs-identifier hs-var">q</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-863"></span><span>    </span><span class="annot"><a href="#local-6989586621679048291"><span class="hs-identifier hs-var">get1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Above"><span class="hs-identifier hs-type">Above</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Doc a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;best get1 Above&quot;</span></span><span>
</span><span id="line-864"></span><span>    </span><span class="annot"><a href="#local-6989586621679048291"><span class="hs-identifier hs-var">get1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Beside"><span class="hs-identifier hs-type">Beside</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Doc a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;best get1 Beside&quot;</span></span><span>
</span><span id="line-865"></span><span>
</span><span id="line-866"></span><span id="local-6989586621679049109"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nicest"><span class="hs-identifier hs-type">nicest</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049109"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049109"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049109"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-867"></span><span id="nicest"><span class="annot"><span class="annottext">nicest :: forall a. Int -&gt; Int -&gt; Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nicest"><span class="hs-identifier hs-var hs-var">nicest</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679048267"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048267"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679048266"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048266"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int -&gt; Doc a -&gt; Doc a -&gt; Doc a
forall a. Int -&gt; Int -&gt; Int -&gt; Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nicest1"><span class="hs-identifier hs-var">nicest1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048267"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048266"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-868"></span><span>
</span><span id="line-869"></span><span id="local-6989586621679049108"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nicest1"><span class="hs-identifier hs-type">nicest1</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049108"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049108"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049108"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-870"></span><span id="nicest1"><span class="annot"><span class="annottext">nicest1 :: forall a. Int -&gt; Int -&gt; Int -&gt; Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nicest1"><span class="hs-identifier hs-var hs-var">nicest1</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679048263"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048263"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679048262"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048262"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679048261"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048261"><span class="hs-identifier hs-var">sl</span></a></span></span><span> </span><span id="local-6989586621679048260"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048260"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679048259"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048259"><span class="hs-identifier hs-var">q</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Doc a -&gt; Bool
forall a. Int -&gt; Doc a -&gt; Bool
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fits"><span class="hs-identifier hs-var">fits</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048263"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Ord a =&gt; a -&gt; a -&gt; a
</span><a href="../../ghc-prim/src/GHC.Classes.html#min"><span class="hs-operator hs-var">`min`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048262"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048261"><span class="hs-identifier hs-var">sl</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048260"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048260"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-871"></span><span>                      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048259"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-872"></span><span>
</span><span id="line-873"></span><span id="local-6989586621679049105"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fits"><span class="hs-identifier hs-type">fits</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>  </span><span class="hs-comment">-- Space available</span><span>
</span><span id="line-874"></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049105"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-875"></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span></span><span> </span><span class="hs-comment">-- True if *first line* of Doc fits in space available</span><span>
</span><span id="line-876"></span><span id="fits"><span class="annot"><span class="annottext">fits :: forall a. Int -&gt; Doc a -&gt; Bool
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fits"><span class="hs-identifier hs-var hs-var">fits</span></a></span></span><span> </span><span id="local-6989586621679048245"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048245"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048245"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C"><span class="hs-operator hs-var">&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span>
</span><span id="line-877"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fits"><span class="hs-identifier hs-var">fits</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span>
</span><span id="line-878"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fits"><span class="hs-identifier hs-var">fits</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span>
</span><span id="line-879"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fits"><span class="hs-identifier hs-var">fits</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NilAbove"><span class="hs-identifier hs-type">NilAbove</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span>
</span><span id="line-880"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fits"><span class="hs-identifier hs-var">fits</span></a></span><span> </span><span id="local-6989586621679048243"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048243"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextBeside"><span class="hs-identifier hs-type">TextBeside</span></a></span><span> </span><span id="local-6989586621679048242"><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048242"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679048241"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048241"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Doc a -&gt; Bool
forall a. Int -&gt; Doc a -&gt; Bool
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fits"><span class="hs-identifier hs-var">fits</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048243"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a -&gt; Int
forall a. AnnotDetails a -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#annotSize"><span class="hs-identifier hs-var">annotSize</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048242"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048241"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-881"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fits"><span class="hs-identifier hs-var">fits</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Above"><span class="hs-identifier hs-type">Above</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Bool
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;fits Above&quot;</span></span><span>
</span><span id="line-882"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fits"><span class="hs-identifier hs-var">fits</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Beside"><span class="hs-identifier hs-type">Beside</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Bool
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;fits Beside&quot;</span></span><span>
</span><span id="line-883"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fits"><span class="hs-identifier hs-var">fits</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Union"><span class="hs-identifier hs-type">Union</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Bool
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;fits Union&quot;</span></span><span>
</span><span id="line-884"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fits"><span class="hs-identifier hs-var">fits</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Nest"><span class="hs-identifier hs-type">Nest</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Bool
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;fits Nest&quot;</span></span><span>
</span><span id="line-885"></span><span>
</span><span id="line-886"></span><span class="hs-comment">-- | @first@ returns its first argument if it is non-empty, otherwise its</span><span>
</span><span id="line-887"></span><span class="hs-comment">-- second.</span><span>
</span><span id="line-888"></span><span id="local-6989586621679048240"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#first"><span class="hs-identifier hs-type">first</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048240"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048240"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048240"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-889"></span><span id="first"><span class="annot"><span class="annottext">first :: forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#first"><span class="hs-identifier hs-var hs-var">first</span></a></span></span><span> </span><span id="local-6989586621679048239"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048239"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679048238"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048238"><span class="hs-identifier hs-var">q</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool
forall a. Doc a -&gt; Bool
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nonEmptySet"><span class="hs-identifier hs-var">nonEmptySet</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048239"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048239"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-comment">-- unused, because (get OneLineMode) is unused</span><span>
</span><span id="line-890"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048238"><span class="hs-identifier hs-var">q</span></a></span><span>
</span><span id="line-891"></span><span>
</span><span id="line-892"></span><span id="local-6989586621679048236"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nonEmptySet"><span class="hs-identifier hs-type">nonEmptySet</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048236"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span></span><span>
</span><span id="line-893"></span><span id="nonEmptySet"><span class="annot"><span class="annottext">nonEmptySet :: forall a. Doc a -&gt; Bool
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nonEmptySet"><span class="hs-identifier hs-var hs-var">nonEmptySet</span></a></span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span>
</span><span id="line-894"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nonEmptySet"><span class="hs-identifier hs-var">nonEmptySet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Union"><span class="hs-operator hs-type">`Union`</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span>
</span><span id="line-895"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nonEmptySet"><span class="hs-identifier hs-var">nonEmptySet</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span>
</span><span id="line-896"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nonEmptySet"><span class="hs-identifier hs-var">nonEmptySet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NilAbove"><span class="hs-identifier hs-type">NilAbove</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#True"><span class="hs-identifier hs-var">True</span></a></span><span>
</span><span id="line-897"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nonEmptySet"><span class="hs-identifier hs-var">nonEmptySet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextBeside"><span class="hs-identifier hs-type">TextBeside</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679048231"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048231"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool
forall a. Doc a -&gt; Bool
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nonEmptySet"><span class="hs-identifier hs-var">nonEmptySet</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048231"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-898"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nonEmptySet"><span class="hs-identifier hs-var">nonEmptySet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Nest"><span class="hs-identifier hs-type">Nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679048230"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048230"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Bool
forall a. Doc a -&gt; Bool
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nonEmptySet"><span class="hs-identifier hs-var">nonEmptySet</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048230"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-899"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nonEmptySet"><span class="hs-identifier hs-var">nonEmptySet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Above"><span class="hs-identifier hs-type">Above</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Bool
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;nonEmptySet Above&quot;</span></span><span>
</span><span id="line-900"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nonEmptySet"><span class="hs-identifier hs-var">nonEmptySet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Beside"><span class="hs-identifier hs-type">Beside</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Bool
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;nonEmptySet Beside&quot;</span></span><span>
</span><span id="line-901"></span><span>
</span><span id="line-902"></span><span class="hs-comment">-- @oneLiner@ returns the one-line members of the given set of @GDoc@s.</span><span>
</span><span id="line-903"></span><span id="local-6989586621679048229"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#oneLiner"><span class="hs-identifier hs-type">oneLiner</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048229"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048229"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-904"></span><span id="oneLiner"><span class="annot"><span class="annottext">oneLiner :: forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#oneLiner"><span class="hs-identifier hs-var hs-var">oneLiner</span></a></span></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>
</span><span id="line-905"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#oneLiner"><span class="hs-identifier hs-var">oneLiner</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>
</span><span id="line-906"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#oneLiner"><span class="hs-identifier hs-var">oneLiner</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NilAbove"><span class="hs-identifier hs-type">NilAbove</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a
forall a. Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>
</span><span id="line-907"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#oneLiner"><span class="hs-identifier hs-var">oneLiner</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextBeside"><span class="hs-identifier hs-type">TextBeside</span></a></span><span> </span><span id="local-6989586621679048224"><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048224"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679048223"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048223"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotDetails a -&gt; Doc a -&gt; Doc a
forall a. AnnotDetails a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#textBeside_"><span class="hs-identifier hs-var">textBeside_</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="#local-6989586621679048224"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#oneLiner"><span class="hs-identifier hs-var">oneLiner</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048223"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-908"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#oneLiner"><span class="hs-identifier hs-var">oneLiner</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Nest"><span class="hs-identifier hs-type">Nest</span></a></span><span> </span><span id="local-6989586621679048222"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048222"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048221"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048221"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Doc a -&gt; Doc a
forall a. Int -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nest_"><span class="hs-identifier hs-var">nest_</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048222"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#oneLiner"><span class="hs-identifier hs-var">oneLiner</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048221"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-909"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#oneLiner"><span class="hs-identifier hs-var">oneLiner</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679048220"><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048220"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Union"><span class="hs-operator hs-type">`Union`</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc a -&gt; Doc a
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#oneLiner"><span class="hs-identifier hs-var">oneLiner</span></a></span><span> </span><span class="annot"><span class="annottext">Doc a
</span><a href="#local-6989586621679048220"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-910"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#oneLiner"><span class="hs-identifier hs-var">oneLiner</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Above"><span class="hs-identifier hs-type">Above</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Doc a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;oneLiner Above&quot;</span></span><span>
</span><span id="line-911"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#oneLiner"><span class="hs-identifier hs-var">oneLiner</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Beside"><span class="hs-identifier hs-type">Beside</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Doc a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;oneLiner Beside&quot;</span></span><span>
</span><span id="line-912"></span><span>
</span><span id="line-913"></span><span>
</span><span id="line-914"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-915"></span><span class="hs-comment">-- Rendering</span><span>
</span><span id="line-916"></span><span>
</span><span id="line-917"></span><span class="hs-comment">-- | A rendering style. Allows us to specify constraints to choose among the</span><span>
</span><span id="line-918"></span><span class="hs-comment">-- many different rendering options.</span><span>
</span><span id="line-919"></span><span id="local-6989586621679048218"><span id="local-6989586621679048219"></span></span><span class="hs-keyword">data</span><span> </span><span id="Style"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Style"><span class="hs-identifier hs-var">Style</span></a></span></span><span>
</span><span id="line-920"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="Style"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Style"><span class="hs-identifier hs-var">Style</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="mode"><span class="annot"><span class="annottext">Style -&gt; Mode
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mode"><span class="hs-identifier hs-var hs-var">mode</span></a></span></span><span>           </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Mode"><span class="hs-identifier hs-type">Mode</span></a></span><span>
</span><span id="line-921"></span><span>            </span><span class="hs-comment">-- ^ The rendering mode.</span><span>
</span><span id="line-922"></span><span>          </span><span class="hs-special">,</span><span> </span><span id="lineLength"><span class="annot"><span class="annottext">Style -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#lineLength"><span class="hs-identifier hs-var hs-var">lineLength</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>
</span><span id="line-923"></span><span>            </span><span class="hs-comment">-- ^ Maximum length of a line, in characters.</span><span>
</span><span id="line-924"></span><span>          </span><span class="hs-special">,</span><span> </span><span id="ribbonsPerLine"><span class="annot"><span class="annottext">Style -&gt; Float
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#ribbonsPerLine"><span class="hs-identifier hs-var hs-var">ribbonsPerLine</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Float"><span class="hs-identifier hs-type">Float</span></a></span><span>
</span><span id="line-925"></span><span>            </span><span class="hs-comment">-- ^ Ratio of line length to ribbon length. A ribbon refers to the</span><span>
</span><span id="line-926"></span><span>            </span><span class="hs-comment">-- characters on a line /excluding/ indentation. So a 'lineLength'</span><span>
</span><span id="line-927"></span><span>            </span><span class="hs-comment">-- of 100, with a 'ribbonsPerLine' of @2.0@ would only allow up to</span><span>
</span><span id="line-928"></span><span>            </span><span class="hs-comment">-- 50 characters of ribbon to be displayed on a line, while</span><span>
</span><span id="line-929"></span><span>            </span><span class="hs-comment">-- allowing it to be indented up to 50 characters.</span><span>
</span><span id="line-930"></span><span>          </span><span class="hs-special">}</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &gt;= 701
</span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679048207"><span id="local-6989586621679048209"><span id="local-6989586621679048215"><span class="annot"><span class="annottext">Int -&gt; Style -&gt; ShowS
[Style] -&gt; ShowS
Style -&gt; String
(Int -&gt; Style -&gt; ShowS)
-&gt; (Style -&gt; String) -&gt; ([Style] -&gt; ShowS) -&gt; Show Style
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; String) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [Style] -&gt; ShowS
$cshowList :: [Style] -&gt; ShowS
show :: Style -&gt; String
$cshow :: Style -&gt; String
showsPrec :: Int -&gt; Style -&gt; ShowS
$cshowsPrec :: Int -&gt; Style -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679048199"><span id="local-6989586621679048205"><span class="annot"><span class="annottext">Style -&gt; Style -&gt; Bool
(Style -&gt; Style -&gt; Bool) -&gt; (Style -&gt; Style -&gt; Bool) -&gt; Eq Style
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: Style -&gt; Style -&gt; Bool
$c/= :: Style -&gt; Style -&gt; Bool
== :: Style -&gt; Style -&gt; Bool
$c== :: Style -&gt; Style -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></a></span></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(forall x. Style -&gt; Rep Style x)
-&gt; (forall x. Rep Style x -&gt; Style) -&gt; Generic Style
forall x. Rep Style x -&gt; Style
forall x. Style -&gt; Rep Style x
forall a.
(forall x. a -&gt; Rep a x) -&gt; (forall x. Rep a x -&gt; a) -&gt; Generic a
$cto :: forall x. Rep Style x -&gt; Style
$cfrom :: forall x. Style -&gt; Rep Style x
</span><a href="../../base/src/GHC.Generics.html#Generic"><span class="hs-identifier hs-var hs-var hs-var hs-var">Generic</span></a></span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-935"></span><span class="hs-comment">-- | The default style (@mode=PageMode, lineLength=100, ribbonsPerLine=1.5@).</span><span>
</span><span id="line-936"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-type">style</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Style"><span class="hs-identifier hs-type">Style</span></a></span><span>
</span><span id="line-937"></span><span id="style"><span class="annot"><span class="annottext">style :: Style
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-var hs-var">style</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Style :: Mode -&gt; Int -&gt; Float -&gt; Style
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Style"><span class="hs-identifier hs-type">Style</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">lineLength :: Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#lineLength"><span class="hs-identifier hs-var">lineLength</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">100</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ribbonsPerLine :: Float
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#ribbonsPerLine"><span class="hs-identifier hs-var">ribbonsPerLine</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Float
</span><span class="hs-number">1.5</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mode :: Mode
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mode"><span class="hs-identifier hs-var">mode</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mode
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#PageMode"><span class="hs-identifier hs-var">PageMode</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-938"></span><span>
</span><span id="line-939"></span><span class="hs-comment">-- | Rendering mode.</span><span>
</span><span id="line-940"></span><span id="local-6989586621679048193"><span id="local-6989586621679048194"></span></span><span class="hs-keyword">data</span><span> </span><span id="Mode"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Mode"><span class="hs-identifier hs-var">Mode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="PageMode"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#PageMode"><span class="hs-identifier hs-var">PageMode</span></a></span></span><span>    </span><span>
</span><span id="line-941"></span><span>            </span><span class="hs-comment">-- ^ Normal rendering ('lineLength' and 'ribbonsPerLine'</span><span>
</span><span id="line-942"></span><span>            </span><span class="hs-comment">-- respected').</span><span>
</span><span id="line-943"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span id="ZigZagMode"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#ZigZagMode"><span class="hs-identifier hs-var">ZigZagMode</span></a></span></span><span>  </span><span>
</span><span id="line-944"></span><span>            </span><span class="hs-comment">-- ^ With zig-zag cuts.</span><span>
</span><span id="line-945"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span id="LeftMode"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#LeftMode"><span class="hs-identifier hs-var">LeftMode</span></a></span></span><span>    </span><span>
</span><span id="line-946"></span><span>            </span><span class="hs-comment">-- ^ No indentation, infinitely long lines ('lineLength' ignored),</span><span>
</span><span id="line-947"></span><span>            </span><span class="hs-comment">-- but explicit new lines, i.e., @text &quot;one&quot; $$ text &quot;two&quot;@, are</span><span>
</span><span id="line-948"></span><span>            </span><span class="hs-comment">-- respected.</span><span>
</span><span id="line-949"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span id="OneLineMode"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#OneLineMode"><span class="hs-identifier hs-var">OneLineMode</span></a></span></span><span> </span><span>
</span><span id="line-950"></span><span>            </span><span class="hs-comment">-- ^ All on one line, 'lineLength' ignored and explicit new lines</span><span>
</span><span id="line-951"></span><span>            </span><span class="hs-comment">-- (@$$@) are turned into spaces.</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &gt;= 701
</span><span>          </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679048184"><span id="local-6989586621679048186"><span id="local-6989586621679048188"><span class="annot"><span class="annottext">Int -&gt; Mode -&gt; ShowS
[Mode] -&gt; ShowS
Mode -&gt; String
(Int -&gt; Mode -&gt; ShowS)
-&gt; (Mode -&gt; String) -&gt; ([Mode] -&gt; ShowS) -&gt; Show Mode
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; String) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [Mode] -&gt; ShowS
$cshowList :: [Mode] -&gt; ShowS
show :: Mode -&gt; String
$cshow :: Mode -&gt; String
showsPrec :: Int -&gt; Mode -&gt; ShowS
$cshowsPrec :: Int -&gt; Mode -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679048180"><span id="local-6989586621679048182"><span class="annot"><span class="annottext">Mode -&gt; Mode -&gt; Bool
(Mode -&gt; Mode -&gt; Bool) -&gt; (Mode -&gt; Mode -&gt; Bool) -&gt; Eq Mode
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: Mode -&gt; Mode -&gt; Bool
$c/= :: Mode -&gt; Mode -&gt; Bool
== :: Mode -&gt; Mode -&gt; Bool
$c== :: Mode -&gt; Mode -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></a></span></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(forall x. Mode -&gt; Rep Mode x)
-&gt; (forall x. Rep Mode x -&gt; Mode) -&gt; Generic Mode
forall x. Rep Mode x -&gt; Mode
forall x. Mode -&gt; Rep Mode x
forall a.
(forall x. a -&gt; Rep a x) -&gt; (forall x. Rep a x -&gt; a) -&gt; Generic a
$cto :: forall x. Rep Mode x -&gt; Mode
$cfrom :: forall x. Mode -&gt; Rep Mode x
</span><a href="../../base/src/GHC.Generics.html#Generic"><span class="hs-identifier hs-var hs-var hs-var hs-var">Generic</span></a></span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-956"></span><span class="hs-comment">-- | Render the @Doc@ to a String using the default @Style@ (see 'style').</span><span>
</span><span id="line-957"></span><span id="local-6989586621679048176"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#render"><span class="hs-identifier hs-type">render</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679048176"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span></span><span>
</span><span id="line-958"></span><span id="render"><span class="annot"><span class="annottext">render :: forall a. Doc a -&gt; String
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#render"><span class="hs-identifier hs-var hs-var">render</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mode
-&gt; Int
-&gt; Float
-&gt; (TextDetails -&gt; ShowS)
-&gt; String
-&gt; Doc a
-&gt; String
forall a b.
Mode -&gt; Int -&gt; Float -&gt; (TextDetails -&gt; a -&gt; a) -&gt; a -&gt; Doc b -&gt; a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fullRender"><span class="hs-identifier hs-var">fullRender</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Mode
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mode"><span class="hs-identifier hs-var hs-var">mode</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-var">style</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#lineLength"><span class="hs-identifier hs-var hs-var">lineLength</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-var">style</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Float
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#ribbonsPerLine"><span class="hs-identifier hs-var hs-var">ribbonsPerLine</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-var">style</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-959"></span><span>                    </span><span class="annot"><span class="annottext">TextDetails -&gt; ShowS
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#txtPrinter"><span class="hs-identifier hs-var">txtPrinter</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-960"></span><span>
</span><span id="line-961"></span><span class="hs-comment">-- | Render the @Doc@ to a String using the given @Style@.</span><span>
</span><span id="line-962"></span><span id="local-6989586621679049099"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#renderStyle"><span class="hs-identifier hs-type">renderStyle</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Style"><span class="hs-identifier hs-type">Style</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049099"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span></span><span>
</span><span id="line-963"></span><span id="renderStyle"><span class="annot"><span class="annottext">renderStyle :: forall a. Style -&gt; Doc a -&gt; String
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#renderStyle"><span class="hs-identifier hs-var hs-var">renderStyle</span></a></span></span><span> </span><span id="local-6989586621679048175"><span class="annot"><span class="annottext">Style
</span><a href="#local-6989586621679048175"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mode
-&gt; Int
-&gt; Float
-&gt; (TextDetails -&gt; ShowS)
-&gt; String
-&gt; Doc a
-&gt; String
forall a b.
Mode -&gt; Int -&gt; Float -&gt; (TextDetails -&gt; a -&gt; a) -&gt; a -&gt; Doc b -&gt; a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fullRender"><span class="hs-identifier hs-var">fullRender</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Mode
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mode"><span class="hs-identifier hs-var hs-var">mode</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="#local-6989586621679048175"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#lineLength"><span class="hs-identifier hs-var hs-var">lineLength</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="#local-6989586621679048175"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Float
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#ribbonsPerLine"><span class="hs-identifier hs-var hs-var">ribbonsPerLine</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="#local-6989586621679048175"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-964"></span><span>                </span><span class="annot"><span class="annottext">TextDetails -&gt; ShowS
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#txtPrinter"><span class="hs-identifier hs-var">txtPrinter</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-965"></span><span>
</span><span id="line-966"></span><span class="hs-comment">-- | Default TextDetails printer.</span><span>
</span><span id="line-967"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#txtPrinter"><span class="hs-identifier hs-type">txtPrinter</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextDetails"><span class="hs-identifier hs-type">TextDetails</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-968"></span><span id="txtPrinter"><span class="annot"><span class="annottext">txtPrinter :: TextDetails -&gt; ShowS
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#txtPrinter"><span class="hs-identifier hs-var hs-var">txtPrinter</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Chr"><span class="hs-identifier hs-type">Chr</span></a></span><span> </span><span id="local-6989586621679048174"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679048174"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">)</span><span>   </span><span id="local-6989586621679048173"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048173"><span class="hs-identifier hs-var">s</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679048174"><span class="hs-identifier hs-var">c</span></a></span><span class="annot"><span class="annottext">Char -&gt; ShowS
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048173"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-969"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#txtPrinter"><span class="hs-identifier hs-var">txtPrinter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Str"><span class="hs-identifier hs-type">Str</span></a></span><span> </span><span id="local-6989586621679048172"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048172"><span class="hs-identifier hs-var">s1</span></a></span></span><span class="hs-special">)</span><span>  </span><span id="local-6989586621679048171"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048171"><span class="hs-identifier hs-var">s2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048172"><span class="hs-identifier hs-var">s1</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048171"><span class="hs-identifier hs-var">s2</span></a></span><span>
</span><span id="line-970"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#txtPrinter"><span class="hs-identifier hs-var">txtPrinter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#PStr"><span class="hs-identifier hs-type">PStr</span></a></span><span> </span><span id="local-6989586621679048170"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048170"><span class="hs-identifier hs-var">s1</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679048169"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048169"><span class="hs-identifier hs-var">s2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048170"><span class="hs-identifier hs-var">s1</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048169"><span class="hs-identifier hs-var">s2</span></a></span><span>
</span><span id="line-971"></span><span>
</span><span id="line-972"></span><span class="hs-comment">-- | The general rendering interface. Please refer to the @Style@ and @Mode@</span><span>
</span><span id="line-973"></span><span class="hs-comment">-- types for a description of rendering mode, line length and ribbons.</span><span>
</span><span id="line-974"></span><span id="local-6989586621679049247"><span id="local-6989586621679049248"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fullRender"><span class="hs-identifier hs-type">fullRender</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Mode"><span class="hs-identifier hs-type">Mode</span></a></span><span>                    </span><span class="hs-comment">-- ^ Rendering mode.</span><span>
</span><span id="line-975"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>                     </span><span class="hs-comment">-- ^ Line length.</span><span>
</span><span id="line-976"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Float"><span class="hs-identifier hs-type">Float</span></a></span><span>                   </span><span class="hs-comment">-- ^ Ribbons per line.</span><span>
</span><span id="line-977"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextDetails"><span class="hs-identifier hs-type">TextDetails</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679049248"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679049248"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ What to do with text.</span><span>
</span><span id="line-978"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679049248"><span class="hs-identifier hs-type">a</span></a></span><span>                       </span><span class="hs-comment">-- ^ What to do at the end.</span><span>
</span><span id="line-979"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049247"><span class="hs-identifier hs-type">b</span></a></span><span>                   </span><span class="hs-comment">-- ^ The document.</span><span>
</span><span id="line-980"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679049248"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>                       </span><span class="hs-comment">-- ^ Result.</span><span>
</span><span id="line-981"></span><span id="fullRender"><span class="annot"><span class="annottext">fullRender :: forall a b.
Mode -&gt; Int -&gt; Float -&gt; (TextDetails -&gt; a -&gt; a) -&gt; a -&gt; Doc b -&gt; a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fullRender"><span class="hs-identifier hs-var hs-var">fullRender</span></a></span></span><span> </span><span id="local-6989586621679048168"><span class="annot"><span class="annottext">Mode
</span><a href="#local-6989586621679048168"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621679048167"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048167"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621679048166"><span class="annot"><span class="annottext">Float
</span><a href="#local-6989586621679048166"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621679048165"><span class="annot"><span class="annottext">TextDetails -&gt; a -&gt; a
</span><a href="#local-6989586621679048165"><span class="hs-identifier hs-var">txt</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mode
-&gt; Int -&gt; Float -&gt; (AnnotDetails b -&gt; a -&gt; a) -&gt; a -&gt; Doc b -&gt; a
forall b a.
Mode
-&gt; Int -&gt; Float -&gt; (AnnotDetails b -&gt; a -&gt; a) -&gt; a -&gt; Doc b -&gt; a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fullRenderAnn"><span class="hs-identifier hs-var">fullRenderAnn</span></a></span><span> </span><span class="annot"><span class="annottext">Mode
</span><a href="#local-6989586621679048168"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048167"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">Float
</span><a href="#local-6989586621679048166"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails b -&gt; a -&gt; a
forall {a}. AnnotDetails a -&gt; a -&gt; a
</span><a href="#local-6989586621679048164"><span class="hs-identifier hs-var">annTxt</span></a></span><span>
</span><span id="line-982"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-983"></span><span>  </span><span id="local-6989586621679048164"><span class="annot"><span class="annottext">annTxt :: AnnotDetails a -&gt; a -&gt; a
</span><a href="#local-6989586621679048164"><span class="hs-identifier hs-var hs-var">annTxt</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoAnnot"><span class="hs-identifier hs-type">NoAnnot</span></a></span><span> </span><span id="local-6989586621679048163"><span class="annot"><span class="annottext">TextDetails
</span><a href="#local-6989586621679048163"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TextDetails -&gt; a -&gt; a
</span><a href="#local-6989586621679048165"><span class="hs-identifier hs-var">txt</span></a></span><span> </span><span class="annot"><span class="annottext">TextDetails
</span><a href="#local-6989586621679048163"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-984"></span><span>  </span><span class="annot"><a href="#local-6989586621679048164"><span class="hs-identifier hs-var">annTxt</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a
</span><span class="hs-identifier">_</span></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; a
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-985"></span><span>
</span><span id="line-986"></span><span class="hs-comment">-- | The general rendering interface, supporting annotations. Please refer to</span><span>
</span><span id="line-987"></span><span class="hs-comment">-- the @Style@ and @Mode@ types for a description of rendering mode, line</span><span>
</span><span id="line-988"></span><span class="hs-comment">-- length and ribbons.</span><span>
</span><span id="line-989"></span><span id="local-6989586621679049093"><span id="local-6989586621679049094"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fullRenderAnn"><span class="hs-identifier hs-type">fullRenderAnn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Mode"><span class="hs-identifier hs-type">Mode</span></a></span><span>                       </span><span class="hs-comment">-- ^ Rendering mode.</span><span>
</span><span id="line-990"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>                        </span><span class="hs-comment">-- ^ Line length.</span><span>
</span><span id="line-991"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Float"><span class="hs-identifier hs-type">Float</span></a></span><span>                      </span><span class="hs-comment">-- ^ Ribbons per line.</span><span>
</span><span id="line-992"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotDetails"><span class="hs-identifier hs-type">AnnotDetails</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049094"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679049093"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679049093"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ What to do with text.</span><span>
</span><span id="line-993"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679049093"><span class="hs-identifier hs-type">a</span></a></span><span>                          </span><span class="hs-comment">-- ^ What to do at the end.</span><span>
</span><span id="line-994"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049094"><span class="hs-identifier hs-type">b</span></a></span><span>                      </span><span class="hs-comment">-- ^ The document.</span><span>
</span><span id="line-995"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679049093"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>                          </span><span class="hs-comment">-- ^ Result.</span><span>
</span><span id="line-996"></span><span id="fullRenderAnn"><span class="annot"><span class="annottext">fullRenderAnn :: forall b a.
Mode
-&gt; Int -&gt; Float -&gt; (AnnotDetails b -&gt; a -&gt; a) -&gt; a -&gt; Doc b -&gt; a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fullRenderAnn"><span class="hs-identifier hs-var hs-var">fullRenderAnn</span></a></span></span><span> </span><span class="annot"><span class="annottext">Mode
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#OneLineMode"><span class="hs-identifier hs-var">OneLineMode</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Float
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679048151"><span class="annot"><span class="annottext">AnnotDetails b -&gt; a -&gt; a
</span><a href="#local-6989586621679048151"><span class="hs-identifier hs-var">txt</span></a></span></span><span> </span><span id="local-6989586621679048150"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679048150"><span class="hs-identifier hs-var">end</span></a></span></span><span> </span><span id="local-6989586621679048149"><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048149"><span class="hs-identifier hs-var">doc</span></a></span></span><span>
</span><span id="line-997"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotDetails b
-&gt; (Doc b -&gt; Doc b -&gt; Doc b)
-&gt; (AnnotDetails b -&gt; a -&gt; a)
-&gt; a
-&gt; Doc b
-&gt; a
forall b a.
AnnotDetails b
-&gt; (Doc b -&gt; Doc b -&gt; Doc b)
-&gt; (AnnotDetails b -&gt; a -&gt; a)
-&gt; a
-&gt; Doc b
-&gt; a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#easyDisplay"><span class="hs-identifier hs-var">easyDisplay</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails b
forall a. AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#spaceText"><span class="hs-identifier hs-var">spaceText</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="annot"><span class="annottext">Doc b
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679048147"><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048147"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048147"><span class="hs-identifier hs-var">y</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">AnnotDetails b -&gt; a -&gt; a
</span><a href="#local-6989586621679048151"><span class="hs-identifier hs-var">txt</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679048150"><span class="hs-identifier hs-var">end</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc b -&gt; Doc b
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var">reduceDoc</span></a></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048149"><span class="hs-identifier hs-var">doc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-998"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fullRenderAnn"><span class="hs-identifier hs-var">fullRenderAnn</span></a></span><span> </span><span class="annot"><span class="annottext">Mode
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#LeftMode"><span class="hs-identifier hs-var">LeftMode</span></a></span><span>    </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Float
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679048146"><span class="annot"><span class="annottext">AnnotDetails b -&gt; a -&gt; a
</span><a href="#local-6989586621679048146"><span class="hs-identifier hs-var">txt</span></a></span></span><span> </span><span id="local-6989586621679048145"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679048145"><span class="hs-identifier hs-var">end</span></a></span></span><span> </span><span id="local-6989586621679048144"><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048144"><span class="hs-identifier hs-var">doc</span></a></span></span><span>
</span><span id="line-999"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotDetails b
-&gt; (Doc b -&gt; Doc b -&gt; Doc b)
-&gt; (AnnotDetails b -&gt; a -&gt; a)
-&gt; a
-&gt; Doc b
-&gt; a
forall b a.
AnnotDetails b
-&gt; (Doc b -&gt; Doc b -&gt; Doc b)
-&gt; (AnnotDetails b -&gt; a -&gt; a)
-&gt; a
-&gt; Doc b
-&gt; a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#easyDisplay"><span class="hs-identifier hs-var">easyDisplay</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails b
forall a. AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nlText"><span class="hs-identifier hs-var">nlText</span></a></span><span> </span><span class="annot"><span class="annottext">Doc b -&gt; Doc b -&gt; Doc b
forall a. Doc a -&gt; Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#first"><span class="hs-identifier hs-var">first</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails b -&gt; a -&gt; a
</span><a href="#local-6989586621679048146"><span class="hs-identifier hs-var">txt</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679048145"><span class="hs-identifier hs-var">end</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc b -&gt; Doc b
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var">reduceDoc</span></a></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048144"><span class="hs-identifier hs-var">doc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1000"></span><span>
</span><span id="line-1001"></span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fullRenderAnn"><span class="hs-identifier hs-var">fullRenderAnn</span></a></span><span> </span><span id="local-6989586621679048143"><span class="annot"><span class="annottext">Mode
</span><a href="#local-6989586621679048143"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621679048142"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048142"><span class="hs-identifier hs-var">lineLen</span></a></span></span><span> </span><span id="local-6989586621679048141"><span class="annot"><span class="annottext">Float
</span><a href="#local-6989586621679048141"><span class="hs-identifier hs-var">ribbons</span></a></span></span><span> </span><span id="local-6989586621679048140"><span class="annot"><span class="annottext">AnnotDetails b -&gt; a -&gt; a
</span><a href="#local-6989586621679048140"><span class="hs-identifier hs-var">txt</span></a></span></span><span> </span><span id="local-6989586621679048139"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679048139"><span class="hs-identifier hs-var">rest</span></a></span></span><span> </span><span id="local-6989586621679048138"><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048138"><span class="hs-identifier hs-var">doc</span></a></span></span><span>
</span><span id="line-1002"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Mode -&gt; Int -&gt; Int -&gt; (AnnotDetails b -&gt; a -&gt; a) -&gt; a -&gt; Doc b -&gt; a
forall b a.
Mode -&gt; Int -&gt; Int -&gt; (AnnotDetails b -&gt; a -&gt; a) -&gt; a -&gt; Doc b -&gt; a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#display"><span class="hs-identifier hs-var">display</span></a></span><span> </span><span class="annot"><span class="annottext">Mode
</span><a href="#local-6989586621679048143"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048142"><span class="hs-identifier hs-var">lineLen</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048136"><span class="hs-identifier hs-var">ribbonLen</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails b -&gt; a -&gt; a
</span><a href="#local-6989586621679048140"><span class="hs-identifier hs-var">txt</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679048139"><span class="hs-identifier hs-var">rest</span></a></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048135"><span class="hs-identifier hs-var">doc'</span></a></span><span>
</span><span id="line-1003"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1004"></span><span>    </span><span id="local-6989586621679048135"><span class="annot"><span class="annottext">doc' :: Doc b
</span><a href="#local-6989586621679048135"><span class="hs-identifier hs-var hs-var">doc'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Doc b -&gt; Doc b
forall a. Int -&gt; Int -&gt; RDoc a -&gt; RDoc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#best"><span class="hs-identifier hs-var">best</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048134"><span class="hs-identifier hs-var">bestLineLen</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048136"><span class="hs-identifier hs-var">ribbonLen</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc b -&gt; Doc b
forall a. Doc a -&gt; Doc a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#reduceDoc"><span class="hs-identifier hs-var">reduceDoc</span></a></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048138"><span class="hs-identifier hs-var">doc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1005"></span><span>
</span><span id="line-1006"></span><span>    </span><span class="annot"><a href="#local-6989586621679048134"><span class="hs-identifier hs-type">bestLineLen</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679048136"><span class="hs-identifier hs-type">ribbonLen</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>
</span><span id="line-1007"></span><span>    </span><span id="local-6989586621679048136"><span class="annot"><span class="annottext">ribbonLen :: Int
</span><a href="#local-6989586621679048136"><span class="hs-identifier hs-var hs-var">ribbonLen</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Float -&gt; Int
forall a b. (RealFrac a, Integral b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#round"><span class="hs-identifier hs-var">round</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Float
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048142"><span class="hs-identifier hs-var">lineLen</span></a></span><span> </span><span class="annot"><span class="annottext">Float -&gt; Float -&gt; Float
forall a. Fractional a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#%2F"><span class="hs-operator hs-var">/</span></a></span><span> </span><span class="annot"><span class="annottext">Float
</span><a href="#local-6989586621679048141"><span class="hs-identifier hs-var">ribbons</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1008"></span><span>    </span><span id="local-6989586621679048134"><span class="annot"><span class="annottext">bestLineLen :: Int
</span><a href="#local-6989586621679048134"><span class="hs-identifier hs-var hs-var">bestLineLen</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Mode
</span><a href="#local-6989586621679048143"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1009"></span><span>                      </span><span class="annot"><span class="annottext">Mode
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#ZigZagMode"><span class="hs-identifier hs-var">ZigZagMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
forall a. Bounded a =&gt; a
</span><a href="../../base/src/GHC.Enum.html#maxBound"><span class="hs-identifier hs-var">maxBound</span></a></span><span>
</span><span id="line-1010"></span><span>                      </span><span class="annot"><span class="annottext">Mode
</span><span class="hs-identifier">_</span></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048142"><span class="hs-identifier hs-var">lineLen</span></a></span><span>
</span><span id="line-1011"></span><span>
</span><span id="line-1012"></span><span id="local-6989586621679049088"><span id="local-6989586621679049089"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#easyDisplay"><span class="hs-identifier hs-type">easyDisplay</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotDetails"><span class="hs-identifier hs-type">AnnotDetails</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049089"><span class="hs-identifier hs-type">b</span></a></span><span>
</span><span id="line-1013"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049089"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049089"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049089"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1014"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotDetails"><span class="hs-identifier hs-type">AnnotDetails</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049089"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679049088"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679049088"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1015"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679049088"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-1016"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049089"><span class="hs-identifier hs-type">b</span></a></span><span>
</span><span id="line-1017"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679049088"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-1018"></span><span id="easyDisplay"><span class="annot"><span class="annottext">easyDisplay :: forall b a.
AnnotDetails b
-&gt; (Doc b -&gt; Doc b -&gt; Doc b)
-&gt; (AnnotDetails b -&gt; a -&gt; a)
-&gt; a
-&gt; Doc b
-&gt; a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#easyDisplay"><span class="hs-identifier hs-var hs-var">easyDisplay</span></a></span></span><span> </span><span id="local-6989586621679048130"><span class="annot"><span class="annottext">AnnotDetails b
</span><a href="#local-6989586621679048130"><span class="hs-identifier hs-var">nlSpaceText</span></a></span></span><span> </span><span id="local-6989586621679048129"><span class="annot"><span class="annottext">Doc b -&gt; Doc b -&gt; Doc b
</span><a href="#local-6989586621679048129"><span class="hs-identifier hs-var">choose</span></a></span></span><span> </span><span id="local-6989586621679048128"><span class="annot"><span class="annottext">AnnotDetails b -&gt; a -&gt; a
</span><a href="#local-6989586621679048128"><span class="hs-identifier hs-var">txt</span></a></span></span><span> </span><span id="local-6989586621679048127"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679048127"><span class="hs-identifier hs-var">end</span></a></span></span><span>
</span><span id="line-1019"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc b -&gt; a
</span><a href="#local-6989586621679048126"><span class="hs-identifier hs-var">lay</span></a></span><span>
</span><span id="line-1020"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1021"></span><span>    </span><span id="local-6989586621679048126"><span class="annot"><span class="annottext">lay :: Doc b -&gt; a
</span><a href="#local-6989586621679048126"><span class="hs-identifier hs-var hs-var">lay</span></a></span></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;easyDisplay: NoDoc&quot;</span></span><span>
</span><span id="line-1022"></span><span>    </span><span class="annot"><a href="#local-6989586621679048126"><span class="hs-identifier hs-var">lay</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Union"><span class="hs-identifier hs-type">Union</span></a></span><span> </span><span id="local-6989586621679048119"><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048119"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679048118"><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048118"><span class="hs-identifier hs-var">q</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc b -&gt; a
</span><a href="#local-6989586621679048126"><span class="hs-identifier hs-var">lay</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Doc b -&gt; Doc b -&gt; Doc b
</span><a href="#local-6989586621679048129"><span class="hs-identifier hs-var">choose</span></a></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048119"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048118"><span class="hs-identifier hs-var">q</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1023"></span><span>    </span><span class="annot"><a href="#local-6989586621679048126"><span class="hs-identifier hs-var">lay</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Nest"><span class="hs-identifier hs-type">Nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679048117"><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048117"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Doc b -&gt; a
</span><a href="#local-6989586621679048126"><span class="hs-identifier hs-var">lay</span></a></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048117"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-1024"></span><span>    </span><span class="annot"><a href="#local-6989586621679048126"><span class="hs-identifier hs-var">lay</span></a></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679048127"><span class="hs-identifier hs-var">end</span></a></span><span>
</span><span id="line-1025"></span><span>    </span><span class="annot"><a href="#local-6989586621679048126"><span class="hs-identifier hs-var">lay</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NilAbove"><span class="hs-identifier hs-type">NilAbove</span></a></span><span> </span><span id="local-6989586621679048116"><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048116"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotDetails b
</span><a href="#local-6989586621679048130"><span class="hs-identifier hs-var">nlSpaceText</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails b -&gt; a -&gt; a
</span><a href="#local-6989586621679048128"><span class="hs-operator hs-var">`txt`</span></a></span><span> </span><span class="annot"><span class="annottext">Doc b -&gt; a
</span><a href="#local-6989586621679048126"><span class="hs-identifier hs-var">lay</span></a></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048116"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-1026"></span><span>    </span><span class="annot"><a href="#local-6989586621679048126"><span class="hs-identifier hs-var">lay</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextBeside"><span class="hs-identifier hs-type">TextBeside</span></a></span><span> </span><span id="local-6989586621679048115"><span class="annot"><span class="annottext">AnnotDetails b
</span><a href="#local-6989586621679048115"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679048114"><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048114"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotDetails b
</span><a href="#local-6989586621679048115"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails b -&gt; a -&gt; a
</span><a href="#local-6989586621679048128"><span class="hs-operator hs-var">`txt`</span></a></span><span> </span><span class="annot"><span class="annottext">Doc b -&gt; a
</span><a href="#local-6989586621679048126"><span class="hs-identifier hs-var">lay</span></a></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048114"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-1027"></span><span>    </span><span class="annot"><a href="#local-6989586621679048126"><span class="hs-identifier hs-var">lay</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Above"><span class="hs-identifier hs-type">Above</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;easyDisplay Above&quot;</span></span><span>
</span><span id="line-1028"></span><span>    </span><span class="annot"><a href="#local-6989586621679048126"><span class="hs-identifier hs-var">lay</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Beside"><span class="hs-identifier hs-type">Beside</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;easyDisplay Beside&quot;</span></span><span>
</span><span id="line-1029"></span><span>
</span><span id="line-1030"></span><span id="local-6989586621679049086"><span id="local-6989586621679049087"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#display"><span class="hs-identifier hs-type">display</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Mode"><span class="hs-identifier hs-type">Mode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotDetails"><span class="hs-identifier hs-type">AnnotDetails</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049087"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679049086"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679049086"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679049086"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049087"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679049086"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-1031"></span><span id="display"><span class="annot"><span class="annottext">display :: forall b a.
Mode -&gt; Int -&gt; Int -&gt; (AnnotDetails b -&gt; a -&gt; a) -&gt; a -&gt; Doc b -&gt; a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#display"><span class="hs-identifier hs-var hs-var">display</span></a></span></span><span> </span><span id="local-6989586621679048110"><span class="annot"><span class="annottext">Mode
</span><a href="#local-6989586621679048110"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679048109"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048109"><span class="hs-identifier hs-var">page_width</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679048108"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048108"><span class="hs-identifier hs-var">ribbon_width</span></a></span></span><span> </span><span id="local-6989586621679048107"><span class="annot"><span class="annottext">AnnotDetails b -&gt; a -&gt; a
</span><a href="#local-6989586621679048107"><span class="hs-identifier hs-var">txt</span></a></span></span><span> </span><span id="local-6989586621679048106"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679048106"><span class="hs-identifier hs-var">end</span></a></span></span><span> </span><span id="local-6989586621679048105"><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048105"><span class="hs-identifier hs-var">doc</span></a></span></span><span>
</span><span id="line-1032"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048109"><span class="hs-identifier hs-var">page_width</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048108"><span class="hs-identifier hs-var">ribbon_width</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621679048104"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048104"><span class="hs-identifier hs-var">gap_width</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1033"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048104"><span class="hs-identifier hs-var">gap_width</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#quot"><span class="hs-operator hs-var">`quot`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621679048102"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048102"><span class="hs-identifier hs-var">shift</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-1034"></span><span>    </span><span class="hs-keyword">let</span><span>
</span><span id="line-1035"></span><span>        </span><span id="local-6989586621679048074"><span class="annot"><span class="annottext">lay :: Int -&gt; Doc b -&gt; a
</span><a href="#local-6989586621679048074"><span class="hs-identifier hs-var hs-var">lay</span></a></span></span><span> </span><span id="local-6989586621679048073"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048073"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><span class="hs-identifier">_</span></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048073"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
forall a. HasCallStack =&gt; a
</span><a href="../../base/src/GHC.Err.html#undefined"><span class="hs-identifier hs-var">undefined</span></a></span><span>
</span><span id="line-1036"></span><span>        </span><span class="annot"><a href="#local-6989586621679048074"><span class="hs-identifier hs-var">lay</span></a></span><span> </span><span id="local-6989586621679048072"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048072"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Nest"><span class="hs-identifier hs-type">Nest</span></a></span><span> </span><span id="local-6989586621679048071"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048071"><span class="hs-identifier hs-var">k1</span></a></span></span><span> </span><span id="local-6989586621679048070"><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048070"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Doc b -&gt; a
</span><a href="#local-6989586621679048074"><span class="hs-identifier hs-var">lay</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048072"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048071"><span class="hs-identifier hs-var">k1</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048070"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-1037"></span><span>        </span><span class="annot"><a href="#local-6989586621679048074"><span class="hs-identifier hs-var">lay</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679048106"><span class="hs-identifier hs-var">end</span></a></span><span>
</span><span id="line-1038"></span><span>        </span><span class="annot"><a href="#local-6989586621679048074"><span class="hs-identifier hs-var">lay</span></a></span><span> </span><span id="local-6989586621679048069"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048069"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NilAbove"><span class="hs-identifier hs-type">NilAbove</span></a></span><span> </span><span id="local-6989586621679048068"><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048068"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotDetails b
forall a. AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nlText"><span class="hs-identifier hs-var">nlText</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails b -&gt; a -&gt; a
</span><a href="#local-6989586621679048107"><span class="hs-operator hs-var">`txt`</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Doc b -&gt; a
</span><a href="#local-6989586621679048074"><span class="hs-identifier hs-var">lay</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048069"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048068"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-1039"></span><span>        </span><span class="annot"><a href="#local-6989586621679048074"><span class="hs-identifier hs-var">lay</span></a></span><span> </span><span id="local-6989586621679048067"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048067"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextBeside"><span class="hs-identifier hs-type">TextBeside</span></a></span><span> </span><span id="local-6989586621679048066"><span class="annot"><span class="annottext">AnnotDetails b
</span><a href="#local-6989586621679048066"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679048065"><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048065"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1040"></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Mode
</span><a href="#local-6989586621679048110"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1041"></span><span>                    </span><span class="annot"><span class="annottext">Mode
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#ZigZagMode"><span class="hs-identifier hs-var">ZigZagMode</span></a></span><span> </span><span class="hs-glyph">|</span><span>  </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048067"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3E%3D"><span class="hs-operator hs-var">&gt;=</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048104"><span class="hs-identifier hs-var">gap_width</span></a></span><span>
</span><span id="line-1042"></span><span>                               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">AnnotDetails b
forall a. AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nlText"><span class="hs-identifier hs-var">nlText</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails b -&gt; a -&gt; a
</span><a href="#local-6989586621679048107"><span class="hs-operator hs-var">`txt`</span></a></span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-1043"></span><span>                                  </span><span class="annot"><span class="annottext">TextDetails -&gt; Int -&gt; AnnotDetails b
forall a. TextDetails -&gt; Int -&gt; AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoAnnot"><span class="hs-identifier hs-var">NoAnnot</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; TextDetails
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Str"><span class="hs-identifier hs-var">Str</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Char -&gt; String
forall a. Int -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048102"><span class="hs-identifier hs-var">shift</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'/'</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048102"><span class="hs-identifier hs-var">shift</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails b -&gt; a -&gt; a
</span><a href="#local-6989586621679048107"><span class="hs-operator hs-var">`txt`</span></a></span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-1044"></span><span>                                  </span><span class="annot"><span class="annottext">AnnotDetails b
forall a. AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nlText"><span class="hs-identifier hs-var">nlText</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails b -&gt; a -&gt; a
</span><a href="#local-6989586621679048107"><span class="hs-operator hs-var">`txt`</span></a></span><span>
</span><span id="line-1045"></span><span>                                  </span><span class="annot"><span class="annottext">Int -&gt; AnnotDetails b -&gt; Doc b -&gt; a
</span><a href="#local-6989586621679048064"><span class="hs-identifier hs-var">lay1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048067"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048102"><span class="hs-identifier hs-var">shift</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">AnnotDetails b
</span><a href="#local-6989586621679048066"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048065"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1046"></span><span>
</span><span id="line-1047"></span><span>                               </span><span class="hs-glyph">|</span><span>  </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048067"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C"><span class="hs-operator hs-var">&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-1048"></span><span>                               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">AnnotDetails b
forall a. AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nlText"><span class="hs-identifier hs-var">nlText</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails b -&gt; a -&gt; a
</span><a href="#local-6989586621679048107"><span class="hs-operator hs-var">`txt`</span></a></span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-1049"></span><span>                                  </span><span class="annot"><span class="annottext">TextDetails -&gt; Int -&gt; AnnotDetails b
forall a. TextDetails -&gt; Int -&gt; AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoAnnot"><span class="hs-identifier hs-var">NoAnnot</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; TextDetails
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Str"><span class="hs-identifier hs-var">Str</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Char -&gt; String
forall a. Int -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048102"><span class="hs-identifier hs-var">shift</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\\'</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048102"><span class="hs-identifier hs-var">shift</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails b -&gt; a -&gt; a
</span><a href="#local-6989586621679048107"><span class="hs-operator hs-var">`txt`</span></a></span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-1050"></span><span>                                  </span><span class="annot"><span class="annottext">AnnotDetails b
forall a. AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nlText"><span class="hs-identifier hs-var">nlText</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails b -&gt; a -&gt; a
</span><a href="#local-6989586621679048107"><span class="hs-operator hs-var">`txt`</span></a></span><span>
</span><span id="line-1051"></span><span>                                  </span><span class="annot"><span class="annottext">Int -&gt; AnnotDetails b -&gt; Doc b -&gt; a
</span><a href="#local-6989586621679048064"><span class="hs-identifier hs-var">lay1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048067"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048102"><span class="hs-identifier hs-var">shift</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">AnnotDetails b
</span><a href="#local-6989586621679048066"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048065"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1052"></span><span>
</span><span id="line-1053"></span><span>                    </span><span class="annot"><span class="annottext">Mode
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int -&gt; AnnotDetails b -&gt; Doc b -&gt; a
</span><a href="#local-6989586621679048064"><span class="hs-identifier hs-var">lay1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048067"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails b
</span><a href="#local-6989586621679048066"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048065"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-1054"></span><span>
</span><span id="line-1055"></span><span>        </span><span class="annot"><a href="#local-6989586621679048074"><span class="hs-identifier hs-var">lay</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Above"><span class="hs-identifier hs-type">Above</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;display lay Above&quot;</span></span><span>
</span><span id="line-1056"></span><span>        </span><span class="annot"><a href="#local-6989586621679048074"><span class="hs-identifier hs-var">lay</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Beside"><span class="hs-identifier hs-type">Beside</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;display lay Beside&quot;</span></span><span>
</span><span id="line-1057"></span><span>        </span><span class="annot"><a href="#local-6989586621679048074"><span class="hs-identifier hs-var">lay</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;display lay NoDoc&quot;</span></span><span>
</span><span id="line-1058"></span><span>        </span><span class="annot"><a href="#local-6989586621679048074"><span class="hs-identifier hs-var">lay</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Union"><span class="hs-identifier hs-type">Union</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;display lay Union&quot;</span></span><span>
</span><span id="line-1059"></span><span>
</span><span id="line-1060"></span><span>        </span><span id="local-6989586621679048064"><span class="annot"><span class="annottext">lay1 :: Int -&gt; AnnotDetails b -&gt; Doc b -&gt; a
</span><a href="#local-6989586621679048064"><span class="hs-identifier hs-var hs-var">lay1</span></a></span></span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679048063"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048063"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679048062"><span class="annot"><span class="annottext">AnnotDetails b
</span><a href="#local-6989586621679048062"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679048061"><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048061"><span class="hs-identifier hs-var">p</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621679048059"><span class="annot"><span class="annottext">r :: Int
</span><a href="#local-6989586621679048059"><span class="hs-identifier hs-var hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048063"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails b -&gt; Int
forall a. AnnotDetails a -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#annotSize"><span class="hs-identifier hs-var">annotSize</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails b
</span><a href="#local-6989586621679048062"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-1061"></span><span>                             </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">TextDetails -&gt; Int -&gt; AnnotDetails b
forall a. TextDetails -&gt; Int -&gt; AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoAnnot"><span class="hs-identifier hs-var">NoAnnot</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; TextDetails
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Str"><span class="hs-identifier hs-var">Str</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; String
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#indent"><span class="hs-identifier hs-var">indent</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048063"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048063"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails b -&gt; a -&gt; a
</span><a href="#local-6989586621679048107"><span class="hs-operator hs-var">`txt`</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">AnnotDetails b
</span><a href="#local-6989586621679048062"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails b -&gt; a -&gt; a
</span><a href="#local-6989586621679048107"><span class="hs-operator hs-var">`txt`</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Doc b -&gt; a
</span><a href="#local-6989586621679048058"><span class="hs-identifier hs-var">lay2</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048059"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048061"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1062"></span><span>
</span><span id="line-1063"></span><span>        </span><span id="local-6989586621679048058"><span class="annot"><span class="annottext">lay2 :: Int -&gt; Doc b -&gt; a
</span><a href="#local-6989586621679048058"><span class="hs-identifier hs-var hs-var">lay2</span></a></span></span><span> </span><span id="local-6989586621679048057"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048057"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048057"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Bool -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Prim.html#seq"><span class="hs-operator hs-var">`seq`</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../ghc-prim/src/GHC.Types.html#False"><span class="hs-identifier hs-var">False</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
forall a. HasCallStack =&gt; a
</span><a href="../../base/src/GHC.Err.html#undefined"><span class="hs-identifier hs-var">undefined</span></a></span><span>
</span><span id="line-1064"></span><span>        </span><span class="annot"><a href="#local-6989586621679048058"><span class="hs-identifier hs-var">lay2</span></a></span><span> </span><span id="local-6989586621679048056"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048056"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NilAbove"><span class="hs-identifier hs-type">NilAbove</span></a></span><span> </span><span id="local-6989586621679048055"><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048055"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotDetails b
forall a. AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#nlText"><span class="hs-identifier hs-var">nlText</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails b -&gt; a -&gt; a
</span><a href="#local-6989586621679048107"><span class="hs-operator hs-var">`txt`</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Doc b -&gt; a
</span><a href="#local-6989586621679048074"><span class="hs-identifier hs-var">lay</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048056"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048055"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-1065"></span><span>        </span><span class="annot"><a href="#local-6989586621679048058"><span class="hs-identifier hs-var">lay2</span></a></span><span> </span><span id="local-6989586621679048054"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048054"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#TextBeside"><span class="hs-identifier hs-type">TextBeside</span></a></span><span> </span><span id="local-6989586621679048053"><span class="annot"><span class="annottext">AnnotDetails b
</span><a href="#local-6989586621679048053"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span id="local-6989586621679048052"><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048052"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotDetails b
</span><a href="#local-6989586621679048053"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails b -&gt; a -&gt; a
</span><a href="#local-6989586621679048107"><span class="hs-operator hs-var">`txt`</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Doc b -&gt; a
</span><a href="#local-6989586621679048058"><span class="hs-identifier hs-var">lay2</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048054"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails b -&gt; Int
forall a. AnnotDetails a -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#annotSize"><span class="hs-identifier hs-var">annotSize</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotDetails b
</span><a href="#local-6989586621679048053"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048052"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-1066"></span><span>        </span><span class="annot"><a href="#local-6989586621679048058"><span class="hs-identifier hs-var">lay2</span></a></span><span> </span><span id="local-6989586621679048051"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048051"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Nest"><span class="hs-identifier hs-type">Nest</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679048050"><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048050"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Doc b -&gt; a
</span><a href="#local-6989586621679048058"><span class="hs-identifier hs-var">lay2</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048051"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048050"><span class="hs-identifier hs-var">p</span></a></span><span>
</span><span id="line-1067"></span><span>        </span><span class="annot"><a href="#local-6989586621679048058"><span class="hs-identifier hs-var">lay2</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Empty"><span class="hs-identifier hs-var">Empty</span></a></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679048106"><span class="hs-identifier hs-var">end</span></a></span><span>
</span><span id="line-1068"></span><span>        </span><span class="annot"><a href="#local-6989586621679048058"><span class="hs-identifier hs-var">lay2</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Above"><span class="hs-identifier hs-type">Above</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;display lay2 Above&quot;</span></span><span>
</span><span id="line-1069"></span><span>        </span><span class="annot"><a href="#local-6989586621679048058"><span class="hs-identifier hs-var">lay2</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Beside"><span class="hs-identifier hs-type">Beside</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;display lay2 Beside&quot;</span></span><span>
</span><span id="line-1070"></span><span>        </span><span class="annot"><a href="#local-6989586621679048058"><span class="hs-identifier hs-var">lay2</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoDoc"><span class="hs-identifier hs-var">NoDoc</span></a></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;display lay2 NoDoc&quot;</span></span><span>
</span><span id="line-1071"></span><span>        </span><span class="annot"><a href="#local-6989586621679048058"><span class="hs-identifier hs-var">lay2</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Union"><span class="hs-identifier hs-type">Union</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;display lay2 Union&quot;</span></span><span>
</span><span id="line-1072"></span><span>    </span><span class="hs-keyword">in</span><span>
</span><span id="line-1073"></span><span>    </span><span class="annot"><span class="annottext">Int -&gt; Doc b -&gt; a
</span><a href="#local-6989586621679048074"><span class="hs-identifier hs-var">lay</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Doc b
</span><a href="#local-6989586621679048105"><span class="hs-identifier hs-var">doc</span></a></span><span>
</span><span id="line-1074"></span><span>    </span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-1075"></span><span>
</span><span id="line-1076"></span><span>
</span><span id="line-1077"></span><span>
</span><span id="line-1078"></span><span class="hs-comment">-- Rendering Annotations -------------------------------------------------------</span><span>
</span><span id="line-1079"></span><span>
</span><span id="line-1080"></span><span class="hs-comment">-- | A @Span@ represents the result of an annotation after a @Doc@ has been</span><span>
</span><span id="line-1081"></span><span class="hs-comment">-- rendered, capturing where the annotation now starts and ends in the rendered</span><span>
</span><span id="line-1082"></span><span class="hs-comment">-- output.</span><span>
</span><span id="line-1083"></span><span class="hs-keyword">data</span><span> </span><span id="Span"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Span"><span class="hs-identifier hs-var">Span</span></a></span></span><span> </span><span id="local-6989586621679049074"><span class="annot"><a href="#local-6989586621679049074"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Span"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Span"><span class="hs-identifier hs-var">Span</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="spanStart"><span class="annot"><span class="annottext">forall a. Span a -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#spanStart"><span class="hs-identifier hs-var hs-var">spanStart</span></a></span></span><span>      </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>
</span><span id="line-1084"></span><span>                   </span><span class="hs-special">,</span><span> </span><span id="spanLength"><span class="annot"><span class="annottext">forall a. Span a -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#spanLength"><span class="hs-identifier hs-var hs-var">spanLength</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>
</span><span id="line-1085"></span><span>                   </span><span class="hs-special">,</span><span> </span><span id="spanAnnotation"><span class="annot"><span class="annottext">forall a. Span a -&gt; a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#spanAnnotation"><span class="hs-identifier hs-var hs-var">spanAnnotation</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679049074"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-1086"></span><span>                   </span><span class="hs-special">}</span><span> </span><span class="hs-keyword">deriving</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679048036"><span id="local-6989586621679048038"><span id="local-6989586621679048044"><span class="annot"><span class="annottext">Int -&gt; Span a -&gt; ShowS
[Span a] -&gt; ShowS
Span a -&gt; String
(Int -&gt; Span a -&gt; ShowS)
-&gt; (Span a -&gt; String) -&gt; ([Span a] -&gt; ShowS) -&gt; Show (Span a)
forall a. Show a =&gt; Int -&gt; Span a -&gt; ShowS
forall a. Show a =&gt; [Span a] -&gt; ShowS
forall a. Show a =&gt; Span a -&gt; String
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; String) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [Span a] -&gt; ShowS
$cshowList :: forall a. Show a =&gt; [Span a] -&gt; ShowS
show :: Span a -&gt; String
$cshow :: forall a. Show a =&gt; Span a -&gt; String
showsPrec :: Int -&gt; Span a -&gt; ShowS
$cshowsPrec :: forall a. Show a =&gt; Int -&gt; Span a -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span class="hs-special">,</span><span id="local-6989586621679048029"><span id="local-6989586621679048034"><span class="annot"><span class="annottext">Span a -&gt; Span a -&gt; Bool
(Span a -&gt; Span a -&gt; Bool)
-&gt; (Span a -&gt; Span a -&gt; Bool) -&gt; Eq (Span a)
forall a. Eq a =&gt; Span a -&gt; Span a -&gt; Bool
forall a. (a -&gt; a -&gt; Bool) -&gt; (a -&gt; a -&gt; Bool) -&gt; Eq a
/= :: Span a -&gt; Span a -&gt; Bool
$c/= :: forall a. Eq a =&gt; Span a -&gt; Span a -&gt; Bool
== :: Span a -&gt; Span a -&gt; Bool
$c== :: forall a. Eq a =&gt; Span a -&gt; Span a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#Eq"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var">Eq</span></a></span></span></span><span class="hs-special">)</span><span>
</span><span id="line-1087"></span><span>
</span><span id="line-1088"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679048026"><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Span"><span class="hs-identifier hs-type">Span</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-1089"></span><span>  </span><span id="local-6989586621679048025"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; Span a -&gt; Span b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span id="local-6989586621679048024"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679048024"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Span"><span class="hs-identifier hs-type">Span</span></a></span><span> </span><span id="local-6989586621679048023"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048023"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621679048022"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048022"><span class="hs-identifier hs-var">y</span></a></span></span><span> </span><span id="local-6989586621679048021"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679048021"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; b -&gt; Span b
forall a. Int -&gt; Int -&gt; a -&gt; Span a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Span"><span class="hs-identifier hs-var">Span</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048023"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048022"><span class="hs-identifier hs-var">y</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679048024"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679048021"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1090"></span><span>
</span><span id="line-1091"></span><span>
</span><span id="line-1092"></span><span class="hs-comment">-- State required for generating document spans.</span><span>
</span><span id="line-1093"></span><span class="hs-keyword">data</span><span> </span><span id="Spans"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Spans"><span class="hs-identifier hs-var">Spans</span></a></span></span><span> </span><span id="local-6989586621679049068"><span class="annot"><a href="#local-6989586621679049068"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="Spans"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Spans"><span class="hs-identifier hs-var">Spans</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="sOffset"><span class="annot"><span class="annottext">forall a. Spans a -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sOffset"><span class="hs-identifier hs-var hs-var">sOffset</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span>
</span><span id="line-1094"></span><span>                       </span><span class="hs-comment">-- ^ Current offset from the end of the document.</span><span>
</span><span id="line-1095"></span><span>                     </span><span class="hs-special">,</span><span> </span><span id="sStack"><span class="annot"><span class="annottext">forall a. Spans a -&gt; [Int -&gt; Span a]
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sStack"><span class="hs-identifier hs-var hs-var">sStack</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Int"><span class="hs-identifier hs-type">Int</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Span"><span class="hs-identifier hs-type">Span</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049068"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1096"></span><span>                       </span><span class="hs-comment">-- ^ Currently open spans.</span><span>
</span><span id="line-1097"></span><span>                     </span><span class="hs-special">,</span><span> </span><span id="sSpans"><span class="annot"><span class="annottext">forall a. Spans a -&gt; [Span a]
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sSpans"><span class="hs-identifier hs-var hs-var">sSpans</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Span"><span class="hs-identifier hs-type">Span</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049068"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1098"></span><span>                       </span><span class="hs-comment">-- ^ Collected annotation regions.</span><span>
</span><span id="line-1099"></span><span>                     </span><span class="hs-special">,</span><span> </span><span id="sOutput"><span class="annot"><span class="annottext">forall a. Spans a -&gt; String
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sOutput"><span class="hs-identifier hs-var hs-var">sOutput</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-1100"></span><span>                       </span><span class="hs-comment">-- ^ Collected output.</span><span>
</span><span id="line-1101"></span><span>                     </span><span class="hs-special">}</span><span>
</span><span id="line-1102"></span><span>
</span><span id="line-1103"></span><span class="hs-comment">-- | Render an annotated @Doc@ to a String and list of annotations (see 'Span')</span><span>
</span><span id="line-1104"></span><span class="hs-comment">-- using the default @Style@ (see 'style').</span><span>
</span><span id="line-1105"></span><span id="local-6989586621679049062"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#renderSpans"><span class="hs-identifier hs-type">renderSpans</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049062"><span class="hs-identifier hs-type">ann</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span class="hs-special">[</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Span"><span class="hs-identifier hs-type">Span</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049062"><span class="hs-identifier hs-type">ann</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span></span><span>
</span><span id="line-1106"></span><span id="renderSpans"><span class="annot"><span class="annottext">renderSpans :: forall ann. Doc ann -&gt; (String, [Span ann])
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#renderSpans"><span class="hs-identifier hs-var hs-var">renderSpans</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Spans ann -&gt; (String, [Span ann])
forall {a}. Spans a -&gt; (String, [Span a])
</span><a href="#local-6989586621679048015"><span class="hs-identifier hs-var">finalize</span></a></span><span>
</span><span id="line-1107"></span><span>             </span><span class="annot"><span class="annottext">(Spans ann -&gt; (String, [Span ann]))
-&gt; (Doc ann -&gt; Spans ann) -&gt; Doc ann -&gt; (String, [Span ann])
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Mode
-&gt; Int
-&gt; Float
-&gt; (AnnotDetails ann -&gt; Spans ann -&gt; Spans ann)
-&gt; Spans ann
-&gt; Doc ann
-&gt; Spans ann
forall b a.
Mode
-&gt; Int -&gt; Float -&gt; (AnnotDetails b -&gt; a -&gt; a) -&gt; a -&gt; Doc b -&gt; a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fullRenderAnn"><span class="hs-identifier hs-var">fullRenderAnn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Mode
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mode"><span class="hs-identifier hs-var hs-var">mode</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-var">style</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#lineLength"><span class="hs-identifier hs-var hs-var">lineLength</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-var">style</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Float
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#ribbonsPerLine"><span class="hs-identifier hs-var hs-var">ribbonsPerLine</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-var">style</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1108"></span><span>                  </span><span class="annot"><span class="annottext">AnnotDetails ann -&gt; Spans ann -&gt; Spans ann
forall {a}. AnnotDetails a -&gt; Spans a -&gt; Spans a
</span><a href="#local-6989586621679048014"><span class="hs-identifier hs-var">spanPrinter</span></a></span><span>
</span><span id="line-1109"></span><span>                  </span><span class="annot"><span class="annottext">Spans :: forall a. Int -&gt; [Int -&gt; Span a] -&gt; [Span a] -&gt; String -&gt; Spans a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Spans"><span class="hs-identifier hs-type">Spans</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sOffset :: Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sOffset"><span class="hs-identifier hs-var">sOffset</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sStack :: [Int -&gt; Span ann]
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sStack"><span class="hs-identifier hs-var">sStack</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sSpans :: [Span ann]
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sSpans"><span class="hs-identifier hs-var">sSpans</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sOutput :: String
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sOutput"><span class="hs-identifier hs-var">sOutput</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1110"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1111"></span><span>
</span><span id="line-1112"></span><span>  </span><span id="local-6989586621679048015"><span class="annot"><span class="annottext">finalize :: Spans a -&gt; (String, [Span a])
</span><a href="#local-6989586621679048015"><span class="hs-identifier hs-var hs-var">finalize</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Spans"><span class="hs-identifier hs-type">Spans</span></a></span><span> </span><span id="local-6989586621679048013"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048013"><span class="hs-identifier hs-var">size</span></a></span></span><span> </span><span class="annot"><span class="annottext">[Int -&gt; Span a]
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679048012"><span class="annot"><span class="annottext">[Span a]
</span><a href="#local-6989586621679048012"><span class="hs-identifier hs-var">spans</span></a></span></span><span> </span><span id="local-6989586621679048011"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048011"><span class="hs-identifier hs-var">out</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679048011"><span class="hs-identifier hs-var">out</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(Span a -&gt; Span a) -&gt; [Span a] -&gt; [Span a]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Span a -&gt; Span a
forall {a}. Span a -&gt; Span a
</span><a href="#local-6989586621679048010"><span class="hs-identifier hs-var">adjust</span></a></span><span> </span><span class="annot"><span class="annottext">[Span a]
</span><a href="#local-6989586621679048012"><span class="hs-identifier hs-var">spans</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1113"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-1114"></span><span>    </span><span id="local-6989586621679048010"><span class="annot"><span class="annottext">adjust :: Span a -&gt; Span a
</span><a href="#local-6989586621679048010"><span class="hs-identifier hs-var hs-var">adjust</span></a></span></span><span> </span><span id="local-6989586621679048008"><span class="annot"><span class="annottext">Span a
</span><a href="#local-6989586621679048008"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Span a
</span><a href="#local-6989586621679048008"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">spanStart :: Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#spanStart"><span class="hs-identifier hs-var">spanStart</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048013"><span class="hs-identifier hs-var">size</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Span a -&gt; Int
forall a. Span a -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#spanStart"><span class="hs-identifier hs-var hs-var">spanStart</span></a></span><span> </span><span class="annot"><span class="annottext">Span a
</span><a href="#local-6989586621679048008"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1115"></span><span>
</span><span id="line-1116"></span><span>  </span><span id="local-6989586621679048006"><span class="annot"><span class="annottext">mkSpan :: a -&gt; Int -&gt; Int -&gt; Span a
</span><a href="#local-6989586621679048006"><span class="hs-identifier hs-var hs-var">mkSpan</span></a></span></span><span> </span><span id="local-6989586621679048005"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679048005"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679048004"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048004"><span class="hs-identifier hs-var">end</span></a></span></span><span> </span><span id="local-6989586621679048003"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048003"><span class="hs-identifier hs-var">start</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Span :: forall a. Int -&gt; Int -&gt; a -&gt; Span a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Span"><span class="hs-identifier hs-type">Span</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">spanStart :: Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#spanStart"><span class="hs-identifier hs-var">spanStart</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048003"><span class="hs-identifier hs-var">start</span></a></span><span>
</span><span id="line-1117"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">spanLength :: Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#spanLength"><span class="hs-identifier hs-var">spanLength</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048003"><span class="hs-identifier hs-var">start</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679048004"><span class="hs-identifier hs-var">end</span></a></span><span>
</span><span id="line-1118"></span><span>                              </span><span class="hs-comment">-- this seems wrong, but remember that it's</span><span>
</span><span id="line-1119"></span><span>                              </span><span class="hs-comment">-- working backwards at this point</span><span>
</span><span id="line-1120"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">spanAnnotation :: a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#spanAnnotation"><span class="hs-identifier hs-var">spanAnnotation</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679048005"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1121"></span><span>
</span><span id="line-1122"></span><span>  </span><span class="hs-comment">-- the document gets generated in reverse, which is why the starting</span><span>
</span><span id="line-1123"></span><span>  </span><span class="hs-comment">-- annotation ends the annotation.</span><span>
</span><span id="line-1124"></span><span>  </span><span id="local-6989586621679048014"><span class="annot"><span class="annottext">spanPrinter :: AnnotDetails a -&gt; Spans a -&gt; Spans a
</span><a href="#local-6989586621679048014"><span class="hs-identifier hs-var hs-var">spanPrinter</span></a></span></span><span> </span><span class="annot"><span class="annottext">AnnotDetails a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotStart"><span class="hs-identifier hs-var">AnnotStart</span></a></span><span> </span><span id="local-6989586621679047997"><span class="annot"><span class="annottext">Spans a
</span><a href="#local-6989586621679047997"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1125"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Spans a -&gt; [Int -&gt; Span a]
forall a. Spans a -&gt; [Int -&gt; Span a]
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sStack"><span class="hs-identifier hs-var hs-var">sStack</span></a></span><span> </span><span class="annot"><span class="annottext">Spans a
</span><a href="#local-6989586621679047997"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1126"></span><span>      </span><span id="local-6989586621679047996"><span class="annot"><span class="annottext">Int -&gt; Span a
</span><a href="#local-6989586621679047996"><span class="hs-identifier hs-var">sp</span></a></span></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span> </span><span id="local-6989586621679047995"><span class="annot"><span class="annottext">[Int -&gt; Span a]
</span><a href="#local-6989586621679047995"><span class="hs-identifier hs-var">rest</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Spans a
</span><a href="#local-6989586621679047997"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sSpans :: [Span a]
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sSpans"><span class="hs-identifier hs-var">sSpans</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Span a
</span><a href="#local-6989586621679047996"><span class="hs-identifier hs-var">sp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Spans a -&gt; Int
forall a. Spans a -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sOffset"><span class="hs-identifier hs-var hs-var">sOffset</span></a></span><span> </span><span class="annot"><span class="annottext">Spans a
</span><a href="#local-6989586621679047997"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Span a -&gt; [Span a] -&gt; [Span a]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">Spans a -&gt; [Span a]
forall a. Spans a -&gt; [Span a]
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sSpans"><span class="hs-identifier hs-var hs-var">sSpans</span></a></span><span> </span><span class="annot"><span class="annottext">Spans a
</span><a href="#local-6989586621679047997"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sStack :: [Int -&gt; Span a]
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sStack"><span class="hs-identifier hs-var">sStack</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Int -&gt; Span a]
</span><a href="#local-6989586621679047995"><span class="hs-identifier hs-var">rest</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1127"></span><span>      </span><span class="annot"><span class="annottext">[Int -&gt; Span a]
</span><span class="hs-identifier">_</span></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; Spans a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;renderSpans: stack underflow&quot;</span></span><span>
</span><span id="line-1128"></span><span>
</span><span id="line-1129"></span><span>  </span><span class="annot"><a href="#local-6989586621679048014"><span class="hs-identifier hs-var">spanPrinter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotEnd"><span class="hs-identifier hs-type">AnnotEnd</span></a></span><span> </span><span id="local-6989586621679047994"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679047994"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679047993"><span class="annot"><span class="annottext">Spans a
</span><a href="#local-6989586621679047993"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1130"></span><span>    </span><span class="annot"><span class="annottext">Spans a
</span><a href="#local-6989586621679047993"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sStack :: [Int -&gt; Span a]
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sStack"><span class="hs-identifier hs-var">sStack</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; Int -&gt; Int -&gt; Span a
forall {a}. a -&gt; Int -&gt; Int -&gt; Span a
</span><a href="#local-6989586621679048006"><span class="hs-identifier hs-var">mkSpan</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679047994"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Spans a -&gt; Int
forall a. Spans a -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sOffset"><span class="hs-identifier hs-var hs-var">sOffset</span></a></span><span> </span><span class="annot"><span class="annottext">Spans a
</span><a href="#local-6989586621679047993"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Int -&gt; Span a) -&gt; [Int -&gt; Span a] -&gt; [Int -&gt; Span a]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">Spans a -&gt; [Int -&gt; Span a]
forall a. Spans a -&gt; [Int -&gt; Span a]
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sStack"><span class="hs-identifier hs-var hs-var">sStack</span></a></span><span> </span><span class="annot"><span class="annottext">Spans a
</span><a href="#local-6989586621679047993"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1131"></span><span>
</span><span id="line-1132"></span><span>  </span><span class="annot"><a href="#local-6989586621679048014"><span class="hs-identifier hs-var">spanPrinter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoAnnot"><span class="hs-identifier hs-type">NoAnnot</span></a></span><span> </span><span id="local-6989586621679047992"><span class="annot"><span class="annottext">TextDetails
</span><a href="#local-6989586621679047992"><span class="hs-identifier hs-var">td</span></a></span></span><span> </span><span id="local-6989586621679047991"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679047991"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621679047990"><span class="annot"><span class="annottext">Spans a
</span><a href="#local-6989586621679047990"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1133"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">TextDetails
</span><a href="#local-6989586621679047992"><span class="hs-identifier hs-var">td</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1134"></span><span>      </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Chr"><span class="hs-identifier hs-type">Chr</span></a></span><span>  </span><span id="local-6989586621679047989"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679047989"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Spans a
</span><a href="#local-6989586621679047990"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sOutput :: String
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sOutput"><span class="hs-identifier hs-var">sOutput</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679047989"><span class="hs-identifier hs-var">c</span></a></span><span>  </span><span class="annot"><span class="annottext">Char -&gt; ShowS
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">Spans a -&gt; String
forall a. Spans a -&gt; String
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sOutput"><span class="hs-identifier hs-var hs-var">sOutput</span></a></span><span> </span><span class="annot"><span class="annottext">Spans a
</span><a href="#local-6989586621679047990"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sOffset :: Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sOffset"><span class="hs-identifier hs-var">sOffset</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Spans a -&gt; Int
forall a. Spans a -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sOffset"><span class="hs-identifier hs-var hs-var">sOffset</span></a></span><span> </span><span class="annot"><span class="annottext">Spans a
</span><a href="#local-6989586621679047990"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679047991"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1135"></span><span>      </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Str"><span class="hs-identifier hs-type">Str</span></a></span><span>  </span><span id="local-6989586621679047988"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047988"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Spans a
</span><a href="#local-6989586621679047990"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sOutput :: String
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sOutput"><span class="hs-identifier hs-var">sOutput</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047988"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Spans a -&gt; String
forall a. Spans a -&gt; String
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sOutput"><span class="hs-identifier hs-var hs-var">sOutput</span></a></span><span> </span><span class="annot"><span class="annottext">Spans a
</span><a href="#local-6989586621679047990"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sOffset :: Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sOffset"><span class="hs-identifier hs-var">sOffset</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Spans a -&gt; Int
forall a. Spans a -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sOffset"><span class="hs-identifier hs-var hs-var">sOffset</span></a></span><span> </span><span class="annot"><span class="annottext">Spans a
</span><a href="#local-6989586621679047990"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679047991"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1136"></span><span>      </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#PStr"><span class="hs-identifier hs-type">PStr</span></a></span><span> </span><span id="local-6989586621679047987"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047987"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Spans a
</span><a href="#local-6989586621679047990"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sOutput :: String
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sOutput"><span class="hs-identifier hs-var">sOutput</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047987"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Spans a -&gt; String
forall a. Spans a -&gt; String
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sOutput"><span class="hs-identifier hs-var hs-var">sOutput</span></a></span><span> </span><span class="annot"><span class="annottext">Spans a
</span><a href="#local-6989586621679047990"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sOffset :: Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sOffset"><span class="hs-identifier hs-var">sOffset</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Spans a -&gt; Int
forall a. Spans a -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#sOffset"><span class="hs-identifier hs-var hs-var">sOffset</span></a></span><span> </span><span class="annot"><span class="annottext">Spans a
</span><a href="#local-6989586621679047990"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679047991"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1137"></span><span>
</span><span id="line-1138"></span><span>
</span><span id="line-1139"></span><span class="hs-comment">-- | Render out a String, interpreting the annotations as part of the resulting</span><span>
</span><span id="line-1140"></span><span class="hs-comment">-- document.</span><span>
</span><span id="line-1141"></span><span class="hs-comment">--</span><span>
</span><span id="line-1142"></span><span class="hs-comment">-- /IMPORTANT/: the size of the annotation string does NOT figure into the</span><span>
</span><span id="line-1143"></span><span class="hs-comment">-- layout of the document, so the document will lay out as though the</span><span>
</span><span id="line-1144"></span><span class="hs-comment">-- annotations are not present.</span><span>
</span><span id="line-1145"></span><span id="local-6989586621679049054"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#renderDecorated"><span class="hs-identifier hs-type">renderDecorated</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679049054"><span class="hs-identifier hs-type">ann</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ Starting an annotation.</span><span>
</span><span id="line-1146"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679049054"><span class="hs-identifier hs-type">ann</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ Ending an annotation.</span><span>
</span><span id="line-1147"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049054"><span class="hs-identifier hs-type">ann</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span></span><span>
</span><span id="line-1148"></span><span id="renderDecorated"><span class="annot"><span class="annottext">renderDecorated :: forall ann. (ann -&gt; String) -&gt; (ann -&gt; String) -&gt; Doc ann -&gt; String
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#renderDecorated"><span class="hs-identifier hs-var hs-var">renderDecorated</span></a></span></span><span> </span><span id="local-6989586621679047986"><span class="annot"><span class="annottext">ann -&gt; String
</span><a href="#local-6989586621679047986"><span class="hs-identifier hs-var">startAnn</span></a></span></span><span> </span><span id="local-6989586621679047985"><span class="annot"><span class="annottext">ann -&gt; String
</span><a href="#local-6989586621679047985"><span class="hs-identifier hs-var">endAnn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1149"></span><span>  </span><span class="annot"><span class="annottext">(String, [ann]) -&gt; String
forall {a} {b}. (a, b) -&gt; a
</span><a href="#local-6989586621679047984"><span class="hs-identifier hs-var">finalize</span></a></span><span> </span><span class="annot"><span class="annottext">((String, [ann]) -&gt; String)
-&gt; (Doc ann -&gt; (String, [ann])) -&gt; Doc ann -&gt; String
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Mode
-&gt; Int
-&gt; Float
-&gt; (AnnotDetails ann -&gt; (String, [ann]) -&gt; (String, [ann]))
-&gt; (String, [ann])
-&gt; Doc ann
-&gt; (String, [ann])
forall b a.
Mode
-&gt; Int -&gt; Float -&gt; (AnnotDetails b -&gt; a -&gt; a) -&gt; a -&gt; Doc b -&gt; a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fullRenderAnn"><span class="hs-identifier hs-var">fullRenderAnn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Mode
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mode"><span class="hs-identifier hs-var hs-var">mode</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-var">style</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#lineLength"><span class="hs-identifier hs-var hs-var">lineLength</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-var">style</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Float
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#ribbonsPerLine"><span class="hs-identifier hs-var hs-var">ribbonsPerLine</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-var">style</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1150"></span><span>                 </span><span class="annot"><span class="annottext">AnnotDetails ann -&gt; (String, [ann]) -&gt; (String, [ann])
</span><a href="#local-6989586621679047983"><span class="hs-identifier hs-var">annPrinter</span></a></span><span>
</span><span id="line-1151"></span><span>                 </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-1152"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1153"></span><span>  </span><span id="local-6989586621679047983"><span class="annot"><span class="annottext">annPrinter :: AnnotDetails ann -&gt; (String, [ann]) -&gt; (String, [ann])
</span><a href="#local-6989586621679047983"><span class="hs-identifier hs-var hs-var">annPrinter</span></a></span></span><span> </span><span class="annot"><span class="annottext">AnnotDetails ann
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotStart"><span class="hs-identifier hs-var">AnnotStart</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679047980"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047980"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679047979"><span class="annot"><span class="annottext">[ann]
</span><a href="#local-6989586621679047979"><span class="hs-identifier hs-var">stack</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1154"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[ann]
</span><a href="#local-6989586621679047979"><span class="hs-identifier hs-var">stack</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1155"></span><span>      </span><span id="local-6989586621679047978"><span class="annot"><span class="annottext">ann
</span><a href="#local-6989586621679047978"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span> </span><span id="local-6989586621679047977"><span class="annot"><span class="annottext">[ann]
</span><a href="#local-6989586621679047977"><span class="hs-keyword hs-var">as</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ann -&gt; String
</span><a href="#local-6989586621679047986"><span class="hs-identifier hs-var">startAnn</span></a></span><span> </span><span class="annot"><span class="annottext">ann
</span><a href="#local-6989586621679047978"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047980"><span class="hs-identifier hs-var">rest</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[ann]
</span><a href="#local-6989586621679047977"><span class="hs-keyword hs-var">as</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1156"></span><span>      </span><span class="annot"><span class="annottext">[ann]
</span><span class="hs-identifier">_</span></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; (String, [ann])
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;renderDecorated: stack underflow&quot;</span></span><span>
</span><span id="line-1157"></span><span>
</span><span id="line-1158"></span><span>  </span><span class="annot"><a href="#local-6989586621679047983"><span class="hs-identifier hs-var">annPrinter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotEnd"><span class="hs-identifier hs-type">AnnotEnd</span></a></span><span> </span><span id="local-6989586621679047976"><span class="annot"><span class="annottext">ann
</span><a href="#local-6989586621679047976"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679047975"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047975"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679047974"><span class="annot"><span class="annottext">[ann]
</span><a href="#local-6989586621679047974"><span class="hs-identifier hs-var">stack</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1159"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ann -&gt; String
</span><a href="#local-6989586621679047985"><span class="hs-identifier hs-var">endAnn</span></a></span><span> </span><span class="annot"><span class="annottext">ann
</span><a href="#local-6989586621679047976"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047975"><span class="hs-identifier hs-var">rest</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ann
</span><a href="#local-6989586621679047976"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">ann -&gt; [ann] -&gt; [ann]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">[ann]
</span><a href="#local-6989586621679047974"><span class="hs-identifier hs-var">stack</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1160"></span><span>
</span><span id="line-1161"></span><span>  </span><span class="annot"><a href="#local-6989586621679047983"><span class="hs-identifier hs-var">annPrinter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoAnnot"><span class="hs-identifier hs-type">NoAnnot</span></a></span><span> </span><span id="local-6989586621679047973"><span class="annot"><span class="annottext">TextDetails
</span><a href="#local-6989586621679047973"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679047972"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047972"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679047971"><span class="annot"><span class="annottext">[ann]
</span><a href="#local-6989586621679047971"><span class="hs-identifier hs-var">stack</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1162"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TextDetails -&gt; ShowS
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#txtPrinter"><span class="hs-identifier hs-var">txtPrinter</span></a></span><span> </span><span class="annot"><span class="annottext">TextDetails
</span><a href="#local-6989586621679047973"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047972"><span class="hs-identifier hs-var">rest</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[ann]
</span><a href="#local-6989586621679047971"><span class="hs-identifier hs-var">stack</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1163"></span><span>
</span><span id="line-1164"></span><span>  </span><span id="local-6989586621679047984"><span class="annot"><span class="annottext">finalize :: (a, b) -&gt; a
</span><a href="#local-6989586621679047984"><span class="hs-identifier hs-var hs-var">finalize</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679047970"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679047970"><span class="hs-identifier hs-var">str</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">b
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679047970"><span class="hs-identifier hs-var">str</span></a></span><span>
</span><span id="line-1165"></span><span>
</span><span id="line-1166"></span><span>
</span><span id="line-1167"></span><span class="hs-comment">-- | Render a document with annotations, by interpreting the start and end of</span><span>
</span><span id="line-1168"></span><span class="hs-comment">-- the annotations, as well as the text details in the context of a monad.</span><span>
</span><span id="line-1169"></span><span id="local-6989586621679049048"><span id="local-6989586621679049049"><span id="local-6989586621679049050"><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#renderDecoratedM"><span class="hs-identifier hs-type">renderDecoratedM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049050"><span class="hs-identifier hs-type">m</span></a></span><span>
</span><span id="line-1170"></span><span>                 </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679049049"><span class="hs-identifier hs-type">ann</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679049050"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049048"><span class="hs-identifier hs-type">r</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ Starting an annotation.</span><span>
</span><span id="line-1171"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679049049"><span class="hs-identifier hs-type">ann</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679049050"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049048"><span class="hs-identifier hs-type">r</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ Ending an annotation.</span><span>
</span><span id="line-1172"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679049050"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049048"><span class="hs-identifier hs-type">r</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- ^ Text formatting.</span><span>
</span><span id="line-1173"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679049050"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049048"><span class="hs-identifier hs-type">r</span></a></span><span>             </span><span class="hs-comment">-- ^ Document end.</span><span>
</span><span id="line-1174"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049049"><span class="hs-identifier hs-type">ann</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679049050"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679049048"><span class="hs-identifier hs-type">r</span></a></span></span></span></span><span>
</span><span id="line-1175"></span><span id="renderDecoratedM"><span class="annot"><span class="annottext">renderDecoratedM :: forall (m :: * -&gt; *) ann r.
Monad m =&gt;
(ann -&gt; m r)
-&gt; (ann -&gt; m r) -&gt; (String -&gt; m r) -&gt; m r -&gt; Doc ann -&gt; m r
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#renderDecoratedM"><span class="hs-identifier hs-var hs-var">renderDecoratedM</span></a></span></span><span> </span><span id="local-6989586621679047968"><span class="annot"><span class="annottext">ann -&gt; m r
</span><a href="#local-6989586621679047968"><span class="hs-identifier hs-var">startAnn</span></a></span></span><span> </span><span id="local-6989586621679047967"><span class="annot"><span class="annottext">ann -&gt; m r
</span><a href="#local-6989586621679047967"><span class="hs-identifier hs-var">endAnn</span></a></span></span><span> </span><span id="local-6989586621679047966"><span class="annot"><span class="annottext">String -&gt; m r
</span><a href="#local-6989586621679047966"><span class="hs-identifier hs-var">txt</span></a></span></span><span> </span><span id="local-6989586621679047965"><span class="annot"><span class="annottext">m r
</span><a href="#local-6989586621679047965"><span class="hs-identifier hs-var">docEnd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1176"></span><span>  </span><span class="annot"><span class="annottext">(m r, [ann]) -&gt; m r
forall {a} {b}. (a, b) -&gt; a
</span><a href="#local-6989586621679047964"><span class="hs-identifier hs-var">finalize</span></a></span><span> </span><span class="annot"><span class="annottext">((m r, [ann]) -&gt; m r)
-&gt; (Doc ann -&gt; (m r, [ann])) -&gt; Doc ann -&gt; m r
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Mode
-&gt; Int
-&gt; Float
-&gt; (AnnotDetails ann -&gt; (m r, [ann]) -&gt; (m r, [ann]))
-&gt; (m r, [ann])
-&gt; Doc ann
-&gt; (m r, [ann])
forall b a.
Mode
-&gt; Int -&gt; Float -&gt; (AnnotDetails b -&gt; a -&gt; a) -&gt; a -&gt; Doc b -&gt; a
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#fullRenderAnn"><span class="hs-identifier hs-var">fullRenderAnn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Mode
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#mode"><span class="hs-identifier hs-var hs-var">mode</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-var">style</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Int
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#lineLength"><span class="hs-identifier hs-var hs-var">lineLength</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-var">style</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Style -&gt; Float
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#ribbonsPerLine"><span class="hs-identifier hs-var hs-var">ribbonsPerLine</span></a></span><span> </span><span class="annot"><span class="annottext">Style
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#style"><span class="hs-identifier hs-var">style</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1177"></span><span>                 </span><span class="annot"><span class="annottext">AnnotDetails ann -&gt; (m r, [ann]) -&gt; (m r, [ann])
forall {b}. AnnotDetails ann -&gt; (m b, [ann]) -&gt; (m b, [ann])
</span><a href="#local-6989586621679047963"><span class="hs-identifier hs-var">annPrinter</span></a></span><span>
</span><span id="line-1178"></span><span>                 </span><span class="hs-special">(</span><span class="annot"><span class="annottext">m r
</span><a href="#local-6989586621679047965"><span class="hs-identifier hs-var">docEnd</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-1179"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1180"></span><span>  </span><span id="local-6989586621679047963"><span class="annot"><span class="annottext">annPrinter :: AnnotDetails ann -&gt; (m b, [ann]) -&gt; (m b, [ann])
</span><a href="#local-6989586621679047963"><span class="hs-identifier hs-var hs-var">annPrinter</span></a></span></span><span> </span><span class="annot"><span class="annottext">AnnotDetails ann
</span><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotStart"><span class="hs-identifier hs-var">AnnotStart</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679047955"><span class="annot"><span class="annottext">m b
</span><a href="#local-6989586621679047955"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679047954"><span class="annot"><span class="annottext">[ann]
</span><a href="#local-6989586621679047954"><span class="hs-identifier hs-var">stack</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1181"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[ann]
</span><a href="#local-6989586621679047954"><span class="hs-identifier hs-var">stack</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1182"></span><span>      </span><span id="local-6989586621679047953"><span class="annot"><span class="annottext">ann
</span><a href="#local-6989586621679047953"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-type">:</span></a></span><span> </span><span id="local-6989586621679047952"><span class="annot"><span class="annottext">[ann]
</span><a href="#local-6989586621679047952"><span class="hs-keyword hs-var">as</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ann -&gt; m r
</span><a href="#local-6989586621679047968"><span class="hs-identifier hs-var">startAnn</span></a></span><span> </span><span class="annot"><span class="annottext">ann
</span><a href="#local-6989586621679047953"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">m r -&gt; m b -&gt; m b
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">m b
</span><a href="#local-6989586621679047955"><span class="hs-identifier hs-var">rest</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[ann]
</span><a href="#local-6989586621679047952"><span class="hs-keyword hs-var">as</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1183"></span><span>      </span><span class="annot"><span class="annottext">[ann]
</span><span class="hs-identifier">_</span></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; (m b, [ann])
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;renderDecorated: stack underflow&quot;</span></span><span>
</span><span id="line-1184"></span><span>
</span><span id="line-1185"></span><span>  </span><span class="annot"><a href="#local-6989586621679047963"><span class="hs-identifier hs-var">annPrinter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#AnnotEnd"><span class="hs-identifier hs-type">AnnotEnd</span></a></span><span> </span><span id="local-6989586621679047951"><span class="annot"><span class="annottext">ann
</span><a href="#local-6989586621679047951"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679047950"><span class="annot"><span class="annottext">m b
</span><a href="#local-6989586621679047950"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679047949"><span class="annot"><span class="annottext">[ann]
</span><a href="#local-6989586621679047949"><span class="hs-identifier hs-var">stack</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1186"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ann -&gt; m r
</span><a href="#local-6989586621679047967"><span class="hs-identifier hs-var">endAnn</span></a></span><span> </span><span class="annot"><span class="annottext">ann
</span><a href="#local-6989586621679047951"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">m r -&gt; m b -&gt; m b
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">m b
</span><a href="#local-6989586621679047950"><span class="hs-identifier hs-var">rest</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ann
</span><a href="#local-6989586621679047951"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">ann -&gt; [ann] -&gt; [ann]
forall a. a -&gt; [a] -&gt; [a]
</span><a href="../../ghc-prim/src/GHC.Types.html#%3A"><span class="hs-glyph hs-var">:</span></a></span><span> </span><span class="annot"><span class="annottext">[ann]
</span><a href="#local-6989586621679047949"><span class="hs-identifier hs-var">stack</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1187"></span><span>
</span><span id="line-1188"></span><span>  </span><span class="annot"><a href="#local-6989586621679047963"><span class="hs-identifier hs-var">annPrinter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#NoAnnot"><span class="hs-identifier hs-type">NoAnnot</span></a></span><span> </span><span id="local-6989586621679047948"><span class="annot"><span class="annottext">TextDetails
</span><a href="#local-6989586621679047948"><span class="hs-identifier hs-var">td</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679047947"><span class="annot"><span class="annottext">m b
</span><a href="#local-6989586621679047947"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679047946"><span class="annot"><span class="annottext">[ann]
</span><a href="#local-6989586621679047946"><span class="hs-identifier hs-var">stack</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-1189"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">TextDetails
</span><a href="#local-6989586621679047948"><span class="hs-identifier hs-var">td</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-1190"></span><span>      </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Chr"><span class="hs-identifier hs-type">Chr</span></a></span><span>  </span><span id="local-6989586621679047945"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679047945"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; m r
</span><a href="#local-6989586621679047966"><span class="hs-identifier hs-var">txt</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679047945"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">m r -&gt; m b -&gt; m b
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">m b
</span><a href="#local-6989586621679047947"><span class="hs-identifier hs-var">rest</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[ann]
</span><a href="#local-6989586621679047946"><span class="hs-identifier hs-var">stack</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1191"></span><span>      </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#Str"><span class="hs-identifier hs-type">Str</span></a></span><span>  </span><span id="local-6989586621679047944"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047944"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; m r
</span><a href="#local-6989586621679047966"><span class="hs-identifier hs-var">txt</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047944"><span class="hs-identifier hs-var">s</span></a></span><span>   </span><span class="annot"><span class="annottext">m r -&gt; m b -&gt; m b
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">m b
</span><a href="#local-6989586621679047947"><span class="hs-identifier hs-var">rest</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[ann]
</span><a href="#local-6989586621679047946"><span class="hs-identifier hs-var">stack</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1192"></span><span>      </span><span class="annot"><a href="Text.PrettyPrint.Annotated.HughesPJ.html#PStr"><span class="hs-identifier hs-type">PStr</span></a></span><span> </span><span id="local-6989586621679047943"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047943"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; m r
</span><a href="#local-6989586621679047966"><span class="hs-identifier hs-var">txt</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679047943"><span class="hs-identifier hs-var">s</span></a></span><span>   </span><span class="annot"><span class="annottext">m r -&gt; m b -&gt; m b
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">m b
</span><a href="#local-6989586621679047947"><span class="hs-identifier hs-var">rest</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[ann]
</span><a href="#local-6989586621679047946"><span class="hs-identifier hs-var">stack</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1193"></span><span>
</span><span id="line-1194"></span><span>  </span><span id="local-6989586621679047964"><span class="annot"><span class="annottext">finalize :: (a, b) -&gt; a
</span><a href="#local-6989586621679047964"><span class="hs-identifier hs-var hs-var">finalize</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679047942"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679047942"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">b
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679047942"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-1195"></span></pre></body></html>